对相应页面的修改 Signed-off-by: alan <547533434@qq.com>course_group
parent
3eddca8c6e
commit
63c9804da8
@ -0,0 +1,15 @@
|
||||
class CourseGroup < ActiveRecord::Base
|
||||
# attr_accessible :title, :body
|
||||
belongs_to :course
|
||||
has_many :members
|
||||
|
||||
before_destroy :set_member_nil
|
||||
|
||||
attr_accessible :name
|
||||
|
||||
def set_member_nil
|
||||
if self.members && self.members.count > 0
|
||||
self.members.update_all("course_group_id = 0")
|
||||
end
|
||||
end
|
||||
end
|
@ -1,10 +1,15 @@
|
||||
<div class="member_header">
|
||||
<p>
|
||||
<%= @subPage_title %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="member_content">
|
||||
<%= error_messages_for 'member' %>
|
||||
<%= render :partial => @render_file, :locals => {:members => @members} %>
|
||||
<%= stylesheet_link_tag 'course_group', :media => 'all' %>
|
||||
<div class="st_list">
|
||||
<div class="st_search">
|
||||
<span class="f_l"><%= @subPage_title %></span>
|
||||
<% if @subPage_title == l(:label_student_list) %>
|
||||
<form class="f_l"><%= text_field_tag 'name', params[:name], name: "name", class: 'f_1'%></form>
|
||||
<%= submit_tag l(:label_search), :class => 'f_2' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="member_content">
|
||||
<%= error_messages_for 'member' %>
|
||||
<%= render :partial => @render_file, :locals => {:members => @members} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
class CreateCourseGroups < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :course_groups do |t|
|
||||
t.string :name
|
||||
t.integer :course_id
|
||||
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddColumnToMembers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :members, :course_group_id, :integer, default: 0
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 958 B |
After Width: | Height: | Size: 629 B |
After Width: | Height: | Size: 217 B |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,67 @@
|
||||
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
|
||||
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea,form{ margin:0; padding:0;}
|
||||
div,img,tr,td,textarea,form{ border:0;}
|
||||
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
|
||||
ul,li{ list-style-type:none}
|
||||
.cl{ clear:both; overflow:hidden; }
|
||||
a{ text-decoration:none; }
|
||||
a:hover{ }
|
||||
/**** 常用***/
|
||||
.f_l{ float:left;}
|
||||
.f_r{ float:right;}
|
||||
.b_lblue{ background:#64bdd9;}
|
||||
.b_dblue{ background:#55a1b9; cursor:pointer;}
|
||||
.f_b{ font-weight: bold;}
|
||||
.c_blue{ color:#64bdd9;}
|
||||
.c_grey{ color:#999999;}
|
||||
.c_grey02{ color:#666666;}
|
||||
.f_14{ font-size:14px;}
|
||||
.c_dblue{ color:#3e6d8e;}
|
||||
.c_red{ color:#ec0016;}
|
||||
.w90{width:90px;}
|
||||
.ml10{margin-left:10px;}
|
||||
|
||||
.container{ width:940px; margin:0 auto; font-size:12px;}
|
||||
|
||||
.st_list{ width:688px; padding-left:5px; height:800px;}
|
||||
.st_search{ margin:10px 0;}
|
||||
.st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;}
|
||||
.st_search input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:200px;}
|
||||
.st_search input.f_2{ background:#1c9ec7; padding: 3px; margin-left: 3px; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:45px; height:28px; float:left; font-size:12px; }
|
||||
.st_search a:hover{ background:#048fbb; text-decoration:none;}
|
||||
|
||||
.classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
|
||||
.st_addclass{ margin-top:5px;}
|
||||
.st_addclass ul li{ margin-bottom:10px;}
|
||||
.st_addclass ul li,.st_addclass a,.st_addclass img{ float:left;}
|
||||
.st_addclass img{ margin-top:3px;}
|
||||
.st_addclass a{ color:#0d90c3;}
|
||||
|
||||
.st_box{ margin-top:10px; border-top:1px solid #CCC; padding-top:10px;}
|
||||
.st_box ul li{ float:left;}
|
||||
.st_box_top a{ font-weight:bold; color:#7a7a7a; float:left;}
|
||||
.st_box_top a:hover{ color:#1c9ec7;}
|
||||
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
|
||||
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
|
||||
a.st_img { display:block;width:40px; height:40px; border:1px solid #CCC; padding:1px;}
|
||||
a:hover.st_img { border:1px solid #1c9ec7; }
|
||||
.st_boxlist{ border-bottom:1px dashed #CCC; height:53px; padding-top:10px; }
|
||||
.st_boxlist a{ float:left;}
|
||||
.st_boxlist ul{ float:left; width:200px; margin-left:10px;}
|
||||
.st_boxlist ul li a{ color:#5d5d5d;}
|
||||
.st_boxlist ul li a span{ color:#1c9ec7;}
|
||||
.st_boxlist ul li a:hover span{ color:#ff8e15;}
|
||||
.ml50{ margin-left:50px;}
|
||||
.ml358{ margin-left:358px;}
|
||||
.ml258{ margin-left:254px;}
|
||||
.ml65{ margin-left:65px;}
|
||||
a:hover.st_add{ color:#ff8e15;}
|
||||
|
||||
/****翻页***/
|
||||
.wlist{ margin-top:15px; float:right;}
|
||||
.wlist a{ float:left; border:1px solid #15bccf; padding:0 5px; margin-left:3px; color:#15bccf;}
|
||||
.wlist a:hover{border:1px solid #15bccf; background-color:#15bccf; color:#fff;}
|
||||
.wlist_select a { background-color:#64bdd9; color:#fff;}
|
||||
|
||||
.submit{height:21px;border:0; cursor:pointer; background:url(images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
|
||||
.isTxt{background:#fbfbfb url(images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
|
@ -0,0 +1,11 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the '{}' from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CourseGroupTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
Loading…
Reference in new issue