Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
46c7a4bb9f
|
@ -1,3 +1,4 @@
|
|||
# -*coding:utf-8 -*-
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
|
@ -14,6 +15,7 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class MembersController < ApplicationController
|
||||
model_object Member
|
||||
before_filter :find_model_object, :except => [:index, :create, :autocomplete]
|
||||
|
@ -124,7 +126,13 @@ class MembersController < ApplicationController
|
|||
attrs = params[:membership].dup
|
||||
user_ids = attrs.delete(:user_ids)
|
||||
user_ids.each do |user_id|
|
||||
members << Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id)
|
||||
member = Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id)
|
||||
role = Role.find_by_id(params[:membership][:role_ids])
|
||||
# 这里的判断只能通过角色名,可以弄成常量
|
||||
if role.name == "学生"
|
||||
StudentsForCourse.create(:student_id => user_id, :course_id =>@course.id)
|
||||
end
|
||||
members << member
|
||||
#user_grades << UserGrade.new(:user_id => user_id, :course_id => @course.id)
|
||||
if (params[:membership][:role_ids])
|
||||
role = Role.find(params[:membership][:role_ids][0])
|
||||
|
@ -201,6 +209,15 @@ class MembersController < ApplicationController
|
|||
|
||||
if (params[:membership][:role_ids])
|
||||
role = Role.find(params[:membership][:role_ids][0])
|
||||
# 这里的判断只能通过角色名,可以弄成常量
|
||||
if role.name == "学生"
|
||||
StudentsForCourse.create(:student_id => @member.user_id, :course_id =>@course.id)
|
||||
else
|
||||
joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id)
|
||||
joined.each do |join|
|
||||
join.delete
|
||||
end
|
||||
end
|
||||
if role.allowed_to?(:is_manager)
|
||||
@courseInfo = CourseInfos.new(:user_id => @member.user_id, :course_id => @course.id)
|
||||
@courseInfo.save
|
||||
|
@ -271,6 +288,11 @@ class MembersController < ApplicationController
|
|||
user.destroy
|
||||
end
|
||||
end
|
||||
joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id)
|
||||
joined.each do |join|
|
||||
join.delete
|
||||
end
|
||||
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html { redirect_to_settings_in_courses }
|
||||
|
|
|
@ -642,9 +642,9 @@ class UsersController < ApplicationController
|
|||
return
|
||||
end
|
||||
if @obj.save
|
||||
## 执行成功的操作。
|
||||
logger.debug "#{__FILE__}:#{__LINE__} ===> #{@obj.to_json}"
|
||||
else
|
||||
#捕获异常
|
||||
logger.error "#{__FILE__}:#{__LINE__} ===> #{@obj.errors.try(:full_messages)}"
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -474,11 +474,16 @@ module ApplicationHelper
|
|||
def principals_check_box_tags_ex(name, principals)
|
||||
s = ''
|
||||
principals.each do |principal|
|
||||
if principal.has_attribute?(:userInfo)
|
||||
s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal.userInfo }</label>\n"
|
||||
else
|
||||
s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal}</label>\n"
|
||||
end
|
||||
s.html_safe
|
||||
end
|
||||
|
||||
#扩展的checkbox生成
|
||||
def principals_radio_box_tags_ex(name, principals)
|
||||
s = ''
|
||||
principals.each do |principal|
|
||||
s << "<label>#{ radio_button_tag name, principal.id, false, :id => nil } #{h principal.userInfo }</label>\n"
|
||||
end
|
||||
s.html_safe
|
||||
end
|
||||
|
|
|
@ -104,10 +104,25 @@ module CoursesHelper
|
|||
garble count
|
||||
end
|
||||
|
||||
alias studentCountOrigin studentCount
|
||||
# 注意:此方法有问题,速度慢且结果不准
|
||||
# alias studentCountOrigin studentCount
|
||||
#def studentCount course
|
||||
# count = studentCountOrigin course
|
||||
#garble count
|
||||
# end
|
||||
|
||||
# 学生人数计算
|
||||
# add by nwb
|
||||
def studentCount course
|
||||
count = studentCountOrigin course
|
||||
garble count
|
||||
count = course.student.count
|
||||
if count <= 5
|
||||
result = count.to_s
|
||||
elsif count < 10 && count > 5
|
||||
result = "5+"
|
||||
else
|
||||
result = (count-count % 10).to_s + "+"
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
def eventToLanguageCourse event_type, course
|
||||
|
|
|
@ -42,7 +42,6 @@ module StoresHelper
|
|||
container = attachment.container
|
||||
case container.class.to_s
|
||||
when 'Message'
|
||||
# binding.pry
|
||||
# '项目 > zzz > 论坛 > 帖子xxx'
|
||||
# topic_str = container.project.project_type == 0 ? l(:label_board) : l(:label_new_course)
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class Course < ActiveRecord::Base
|
|||
has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
has_many :homework_for_courses, :dependent => :destroy
|
||||
has_many :student, :through => :students_for_courses, :source => :user
|
||||
has_many :student, :class_name => 'StudentsForCourse', :source => :user
|
||||
has_many :course_infos, :class_name => 'CourseInfos',:dependent => :destroy
|
||||
has_many :enabled_modules, :dependent => :delete_all
|
||||
has_many :boards, :dependent => :destroy, :order => "position ASC"
|
||||
|
@ -36,10 +36,10 @@ class Course < ActiveRecord::Base
|
|||
|
||||
validates_presence_of :password, :term,:name
|
||||
validates_format_of :class_period, :with =>/^[1-9]\d*$/
|
||||
validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
|
||||
#validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
|
||||
|
||||
before_save :self_validate
|
||||
after_save :create_board_sync
|
||||
after_create :create_board_sync
|
||||
before_destroy :delete_all_members
|
||||
|
||||
safe_attributes 'extra',
|
||||
|
|
|
@ -564,8 +564,10 @@ class Issue < ActiveRecord::Base
|
|||
end
|
||||
# 缺陷的短描述信息
|
||||
def short_description(length = 255)
|
||||
description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
# 不再使用短描述
|
||||
#description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||
description
|
||||
end
|
||||
|
||||
private :workflow_rule_by_attribute
|
||||
|
|
|
@ -76,8 +76,10 @@ class News < ActiveRecord::Base
|
|||
|
||||
# 新闻的短描述信息
|
||||
def short_description(length = 255)
|
||||
description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
#description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||
# 不再使用短描述
|
||||
description
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -85,7 +85,9 @@ class OpenSourceProject < ActiveRecord::Base
|
|||
|
||||
def short_description(length = 255)
|
||||
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||
description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
#description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
# 不再使用短描述
|
||||
description
|
||||
end
|
||||
|
||||
def applied_by?(user)
|
||||
|
|
|
@ -127,7 +127,7 @@ class Project < ActiveRecord::Base
|
|||
after_save :update_position_under_parent, :if => Proc.new {|project| project.name_changed?}
|
||||
after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?}
|
||||
# 创建project之后默认创建一个board,之后的board去掉了board的概念
|
||||
after_save :create_board_sync
|
||||
after_create :create_board_sync
|
||||
before_destroy :delete_all_members
|
||||
def remove_references_before_destroy
|
||||
return if self.id.nil?
|
||||
|
@ -630,7 +630,9 @@ class Project < ActiveRecord::Base
|
|||
# Returns a short description of the projects (first lines)
|
||||
def short_description(length = 255)
|
||||
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||
description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
# 不再使用短描述
|
||||
# description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
description
|
||||
end
|
||||
|
||||
def css_classes
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
<%= stylesheet_link_tag 'scm' %>
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_news_plural)) -%>
|
||||
<% html_title(l(:label_contest_notification)) -%>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<% unless contest.author.nil? %>
|
||||
<%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>:
|
||||
<% end %>
|
||||
<%= link_to(contest.name, show_contest_contest_path(contest), :class => 'bid_path', :target => "_blank") %></strong></td>
|
||||
<%= link_to(contest.name, contest_contestnotifications_path(contest), :class => 'bid_path', :target => "_blank") %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="500">
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
<p>
|
||||
<% roles.each do |role| %>
|
||||
<label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
||||
<label><%= radio_button_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
||||
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %> <%= h role %></label><br/>
|
||||
<% end %></p>
|
||||
<%= hidden_field_tag 'membership[role_ids][]', '' %>
|
||||
|
@ -82,7 +82,7 @@
|
|||
<p style="padding-top: 5px"><%= l(:label_role_plural) %>:
|
||||
<% roles.each do |role| %>
|
||||
|
||||
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
|
||||
<label><%= radio_button_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
|
||||
<% end %></p>
|
||||
|
||||
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
|
||||
|
|
|
@ -215,9 +215,9 @@
|
|||
<% if display_main_menu?(@contest) %>
|
||||
<div class="tabs_new">
|
||||
<ul>
|
||||
<li ><%= link_to l(:label_contest_userresponse), show_contest_contest_path(@contest), :class => link_class(:respond) %></li>
|
||||
<li><%= link_to l(:label_contest_joincontest), show_attendingcontest_contest_path(@contest), :class => link_class(:attendingcontests) %></li>
|
||||
<li><%= link_to l(:label_contest_notification), contest_contestnotifications_path(@contest), :class => link_class(:contestnotifications) %></li>
|
||||
<li><%= link_to l(:label_contest_joincontest), show_attendingcontest_contest_path(@contest), :class => link_class(:attendingcontests) %></li>
|
||||
<li><%= link_to l(:label_contest_userresponse), show_contest_contest_path(@contest), :class => link_class(:respond) %></li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -97,7 +97,6 @@
|
|||
<div class="pagination">
|
||||
<ul>
|
||||
<%= pagination_links_full @events_pages %>
|
||||
<% #binding.pry %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -150,14 +150,14 @@
|
|||
<div class="d-p-projectlist">
|
||||
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
|
||||
|
||||
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
|
||||
<li style="overflow:auto;word-break:break-all;height:100%;" class='<%= cycle("odd", "even") %>'>
|
||||
<div class="avatar-4" style="float: left; margin-top: 7px">
|
||||
<%= image_tag('/images/contest1.png')%>
|
||||
</div>
|
||||
|
||||
<div style="float: left; margin-left: 12px; margin-top: 10px; margin-bottom: -4px; width: 380px;">
|
||||
<!-- <%= link_to(contest.name, contest.event_url, :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> -->
|
||||
<%= link_to(contest.name, show_contest_contest_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
|
||||
<%= link_to(contest.name, contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
|
||||
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
|
||||
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
|
||||
<% else %>
|
||||
|
@ -165,8 +165,8 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;">
|
||||
<span class='font_lighter' title =<%=contest.description.to_s%>><%=contest.description.truncate(50, omission: '...')%></span>
|
||||
<div style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;">
|
||||
<span class='font_lighter' title =<%=contest.description.to_s%>><%=contest.description.to_s%></span>
|
||||
</div><br />
|
||||
|
||||
<div style="padding-left: 57px; clear: left;">
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<% #projects = find_miracle_project(10, 3) %>
|
||||
<% @projects.map do |project| %>
|
||||
<!--<%# cache cache_key_for_project(project) do %> -->
|
||||
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
|
||||
<li style="overflow:auto;word-break:break-all;height:100%;" class='<%= cycle("odd", "even") %>'>
|
||||
<div style="float: left;">
|
||||
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
||||
</div>
|
||||
|
@ -72,10 +72,10 @@
|
|||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
|
||||
</div>
|
||||
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 10px; width: 380px;">
|
||||
<span class='font_lighter' title =<%=project.short_description.to_s%>><%=project.short_description.truncate(50, omission: '...')%></span>
|
||||
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;">
|
||||
<span class='font_lighter' title =<%=project.description.to_s%>><%=project.description%></span>
|
||||
</div>
|
||||
<div style="position:absolute; bottom:0;right:0;margin:5px 10px 5px 5px ;">
|
||||
<div >
|
||||
<%# issue_count = project.issues.count %>
|
||||
<%# issue_journal_count = project.issue_changes.count %>
|
||||
<%# issue_score = issue_count * 0.2 %>
|
||||
|
@ -103,7 +103,7 @@
|
|||
|
||||
<%# finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
|
||||
<%= content_tag "span", l(:label_project_score)+ ":" + project_score(project),
|
||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ",
|
||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
|
||||
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
||||
:class => "tooltip",
|
||||
:id => "tooltip-#{project.id}" %>
|
||||
|
|
|
@ -1776,7 +1776,7 @@ zh:
|
|||
label_fork_homework_new: 选为作业
|
||||
#wang
|
||||
label_contest_userresponse: 用户留言
|
||||
label_contest_joincontest: 参入竞赛
|
||||
label_contest_joincontest: 参加竞赛
|
||||
label_contest_notification: 竞赛通知
|
||||
#end
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ a
|
|||
.action-settings #header h1:before
|
||||
{
|
||||
font-family: Fontawesome;
|
||||
/* content: "\f013";*/
|
||||
/* content: "\f013";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f132";*/
|
||||
/* content: "\f132";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f135";*/
|
||||
/* content: "\f135";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f018";*/
|
||||
/* content: "\f018";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f145";*/
|
||||
/* content: "\f145";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f073";*/
|
||||
/* content: "\f073";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f06c";*/
|
||||
/* content: "\f06c";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f02d";*/
|
||||
/* content: "\f02d";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f14b";*/
|
||||
/* content: "\f14b";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f0b1";*/
|
||||
/* content: "\f0b1";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ a
|
|||
|
||||
|
||||
|
||||
/* content: "\f074";*/
|
||||
/* content: "\f074";*/
|
||||
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ a
|
|||
.controller-gantts #header h1:before
|
||||
{
|
||||
font-family: Fontawesome;
|
||||
/* content: "\f080";*/
|
||||
/* content: "\f080";*/
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ a
|
|||
.controller-welcome #header h1:before
|
||||
{
|
||||
font-family: Fontawesome;
|
||||
/* content: "\f015 ";*/
|
||||
/* content: "\f015 ";*/
|
||||
padding-right: 5px;
|
||||
font-weight: 100;
|
||||
}
|
||||
|
@ -281,10 +281,10 @@ a:hover,a:active
|
|||
/*by young
|
||||
.action-index p
|
||||
{
|
||||
margin-top:0;
|
||||
padding-top:0;
|
||||
margin-top:0;
|
||||
padding-top:0;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
ul.projects.root
|
||||
{
|
||||
-webkit-column-count:4;
|
||||
|
@ -315,20 +315,20 @@ ul.projects li.root
|
|||
#header
|
||||
{
|
||||
background-color: #FFFFFF;
|
||||
/* background-image: -moz-linear-gradient(top,#BBBBBB,#FFFFEC);
|
||||
/* background-image: -moz-linear-gradient(top,#BBBBBB,#FFFFEC);
|
||||
background-image: -webkit-gradient(linear,0 0,0 100%,from(#039ea0),to(#f5f1e8));
|
||||
background-image: -webkit-linear-gradient(top,#039ea0,#f5f1e8);
|
||||
background-image: -o-linear-gradient(top,#039ea0,#f5f1e8);
|
||||
background-image: linear-gradient(to bottom,#039ea0,#f5f1e8);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0);*/
|
||||
border-color: #252525;
|
||||
border-color: #252525;
|
||||
|
||||
height: 130px;
|
||||
height: 130px;
|
||||
|
||||
height: 125px;
|
||||
height: 125px;
|
||||
|
||||
color: #000000;
|
||||
color: #000000;
|
||||
}
|
||||
/*控制logo位置,如redmine位置*/
|
||||
#header h1
|
||||
|
@ -409,8 +409,8 @@ ul.projects li.root
|
|||
#content,#main.nosidebar #content
|
||||
{
|
||||
/*by young*/
|
||||
/* background:#fff; /*主题框架背景yanse*/
|
||||
/* border-right:1px solid #bbb;
|
||||
/* background:#fff; /*主题框架背景yanse*/
|
||||
/* border-right:1px solid #bbb;
|
||||
border-bottom:1px solid #bbb;
|
||||
overflow:auto;
|
||||
|
||||
|
@ -586,15 +586,15 @@ div.splitcontentleft h2
|
|||
position:relative;
|
||||
z-index: 2;
|
||||
background: #fff;*/
|
||||
/*font-family:"Microsoft YaHei", "PT Sans", Helvetica, Arial;*/
|
||||
/*font: color: #FFF;*/
|
||||
transition:all .4s linear;
|
||||
-moz-transition:all .4s linear;
|
||||
-o-transition:all .4s linear;
|
||||
-webkit-transition:all .4s linear;
|
||||
background-color:#cdd0cf; /*导航条颜色*/
|
||||
/*font-weight:400;
|
||||
padding:4px 8px 4px;8*/
|
||||
/*font-family:"Microsoft YaHei", "PT Sans", Helvetica, Arial;*/
|
||||
/*font: color: #FFF;*/
|
||||
transition:all .4s linear;
|
||||
-moz-transition:all .4s linear;
|
||||
-o-transition:all .4s linear;
|
||||
-webkit-transition:all .4s linear;
|
||||
background-color:#cdd0cf; /*导航条颜色*/
|
||||
/*font-weight:400;
|
||||
padding:4px 8px 4px;8*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -623,11 +623,11 @@ div.splitcontentleft h2
|
|||
/*by young*/
|
||||
#top-menu li a.home:before {
|
||||
font-family: Fontawesome;
|
||||
/* content: "\f015 ";*/
|
||||
/* content: "\f015 ";*/
|
||||
}
|
||||
#top-menu li a.my-page:before {
|
||||
font-family: Fontawesome;
|
||||
/* content: "\f0c9 ";*/
|
||||
/* content: "\f0c9 ";*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -636,7 +636,7 @@ div.splitcontentleft h2
|
|||
|
||||
content: "\f0c2 ";
|
||||
|
||||
/* content: "\f0c2 ";*/
|
||||
/* content: "\f0c2 ";*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -645,7 +645,7 @@ div.splitcontentleft h2
|
|||
|
||||
content: "\f11b ";
|
||||
|
||||
/* content: "\f11b ";*/
|
||||
/* content: "\f11b ";*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -654,7 +654,7 @@ div.splitcontentleft h2
|
|||
|
||||
content: "\f0e9 ";
|
||||
|
||||
/* content: "\f0e9 ";*/
|
||||
/* content: "\f0e9 ";*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -670,7 +670,7 @@ div.splitcontentleft h2
|
|||
|
||||
#top-menu #account a.logout:before {
|
||||
font-family: Fontawesome;
|
||||
/* content: "\f08b ";*/
|
||||
/* content: "\f08b ";*/
|
||||
}
|
||||
/*end*/
|
||||
|
||||
|
@ -1012,7 +1012,7 @@ pre,code,.line-code
|
|||
border-left:1px solid #bbb;
|
||||
border-right:1px solid #bbb;
|
||||
/*by young*/
|
||||
/* -moz-box-shadow:#bbb 1px 1px 2px;*/
|
||||
/* -moz-box-shadow:#bbb 1px 1px 2px;*/
|
||||
-webkit-box-shadow:2px 2px 0px -2px #bbb;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
@ -1050,20 +1050,20 @@ div.project_tag_info a.root {
|
|||
div.wiki-description {
|
||||
/*word-break; break-all;
|
||||
word-wrap: break-word;*/
|
||||
display: block;
|
||||
/*white-space: nowrap;*/
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
margin-top: 10px;
|
||||
width: 470px;
|
||||
max-height: 121px;
|
||||
font-family: '微软雅黑'; /*modify by men*/
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
overflow: hidden;
|
||||
/*text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;*/
|
||||
display: block;
|
||||
/*white-space: nowrap;*/
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
margin-top: 10px;
|
||||
width: 470px;
|
||||
max-height: 121px;
|
||||
font-family: '微软雅黑'; /*modify by men*/
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
overflow: hidden;
|
||||
/*text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;*/
|
||||
}
|
||||
|
||||
.information {
|
||||
|
@ -1077,10 +1077,10 @@ div.wiki-description {
|
|||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
/*
|
||||
a.project {
|
||||
float: left;
|
||||
float: left;
|
||||
}*/
|
||||
.information_for_course {
|
||||
margin-top: 20px;
|
||||
|
@ -1093,7 +1093,7 @@ a.project {
|
|||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
.img-tag-2{
|
||||
float: left;
|
||||
margin-top: 15px;
|
||||
|
@ -1271,7 +1271,7 @@ div.project-block img.avatar2 {
|
|||
* Designed for user#index.
|
||||
*/
|
||||
|
||||
div.well {
|
||||
div.well {
|
||||
color: black;
|
||||
min-height: 20px;
|
||||
height: auto;
|
||||
|
@ -1334,7 +1334,7 @@ div.pagination {
|
|||
height: 25px;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
div.pagination ul {
|
||||
display: inline-block;
|
||||
|
@ -1416,7 +1416,7 @@ div.pagination_new {
|
|||
height: 36px;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
div.pagination_new ul {
|
||||
border-radius: 2px 2px 2px 2px;
|
||||
|
@ -1517,7 +1517,7 @@ div.issue-note .description {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
/*issue style Added by nie
|
||||
/*issue style Added by nie
|
||||
*/
|
||||
|
||||
div.autoscroll ul.issue_list {
|
||||
|
@ -1608,10 +1608,10 @@ a.bid_user_u {
|
|||
margin-right: 4px;
|
||||
}
|
||||
/*
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
img.avatar {
|
||||
img.avatar {
|
||||
background: rgb(245, 245, 245);
|
||||
padding: 4px;
|
||||
border: 1px solid #e5dfc7;
|
||||
|
@ -1638,7 +1638,7 @@ div.left_wf a {
|
|||
|
||||
/*
|
||||
member style
|
||||
*/
|
||||
*/
|
||||
|
||||
div.member_content div.well {
|
||||
height: auto;
|
||||
|
@ -1784,14 +1784,14 @@ input[type='text'].noline {
|
|||
.noline {
|
||||
/*border-style: none;
|
||||
border-color: white;*/
|
||||
font-family:"Microsoft YaHei"; /*modify by men*/
|
||||
border: #d5dee9 1px solid;
|
||||
font-size: 12px;
|
||||
color: #818283;
|
||||
padding: 9px 5px;
|
||||
width: 98%;
|
||||
cursor: text;
|
||||
border-radius: 4px; /*# added by bai (边框变圆润)*/
|
||||
font-family:"Microsoft YaHei"; /*modify by men*/
|
||||
border: #d5dee9 1px solid;
|
||||
font-size: 12px;
|
||||
color: #818283;
|
||||
padding: 9px 5px;
|
||||
width: 98%;
|
||||
cursor: text;
|
||||
border-radius: 4px; /*# added by bai (边框变圆润)*/
|
||||
}
|
||||
a.reference {
|
||||
font-size: 22px;
|
||||
|
@ -1828,7 +1828,7 @@ div.tableline{
|
|||
*
|
||||
* @2013-09-27
|
||||
/*added by bai*/
|
||||
input[type="submit"], .button_submit {
|
||||
input[type="submit"], .button_submit {
|
||||
padding-bottom: 5px;
|
||||
width: auto;
|
||||
height: 25px;
|
||||
|
@ -1842,13 +1842,13 @@ input[type="submit"], .button_submit {
|
|||
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
|
||||
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
|
||||
cursor: pointer;
|
||||
}
|
||||
.button_submit_font_white{
|
||||
}
|
||||
.button_submit_font_white{
|
||||
color: white !important ;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
input[type="button-submit"] {
|
||||
input[type="button-submit"] {
|
||||
padding-bottom: 5px;
|
||||
width: 55px;
|
||||
height: 25px;
|
||||
|
@ -1858,9 +1858,9 @@ input[type="button-submit"] {
|
|||
padding: 0px;
|
||||
background: #15bccf;
|
||||
border: 1px solid #15bccf;
|
||||
}
|
||||
}
|
||||
|
||||
#button_width_auto {
|
||||
#button_width_auto {
|
||||
padding-bottom: 5px;
|
||||
width: auto;
|
||||
height: 25px;
|
||||
|
@ -1874,12 +1874,12 @@ input[type="button-submit"] {
|
|||
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
|
||||
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
/*end*/
|
||||
/*end*/
|
||||
|
||||
/*added by bai*/
|
||||
a.font-user-color{
|
||||
/*added by bai*/
|
||||
a.font-user-color{
|
||||
color: #FFFFFF;
|
||||
width:90px;
|
||||
background-color: #15BCCF;
|
||||
|
@ -1889,9 +1889,9 @@ a.font-user-color{
|
|||
margin-left:17px;
|
||||
height:25px;
|
||||
line-height:23px;
|
||||
}
|
||||
}
|
||||
|
||||
a.font-user-after-color{
|
||||
a.font-user-after-color{
|
||||
color: #FFFFFF;
|
||||
width:90px;
|
||||
background-color: #15BCCF;
|
||||
|
@ -1899,23 +1899,23 @@ a.font-user-after-color{
|
|||
margin-left:13px;
|
||||
height:25px;
|
||||
line-height:23px;
|
||||
}
|
||||
}
|
||||
|
||||
div.avatar_user{
|
||||
div.avatar_user{
|
||||
position: relative;
|
||||
float:left;
|
||||
margin-top:-30px;
|
||||
margin-left: 550px;
|
||||
}
|
||||
.create-share{
|
||||
}
|
||||
.create-share{
|
||||
border-radius: 5px;
|
||||
padding-top: 3px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
/*#added by nie*/
|
||||
.buttons_for_course a {
|
||||
/*#added by nie*/
|
||||
.buttons_for_course a {
|
||||
display:block;
|
||||
float:left;
|
||||
margin:0 7px 0 0;
|
||||
|
@ -1932,9 +1932,9 @@ div.avatar_user{
|
|||
color:#565656;
|
||||
cursor:pointer;
|
||||
padding:5px 10px 6px 7px; /* Links */
|
||||
}
|
||||
}
|
||||
|
||||
.buttons_for_score a {
|
||||
.buttons_for_score a {
|
||||
display:block;
|
||||
float:left;
|
||||
margin:0 7px 0 0;
|
||||
|
@ -1951,53 +1951,53 @@ div.avatar_user{
|
|||
color:#565656;
|
||||
cursor:pointer;
|
||||
padding:5px 10px 6px 7px; /* Links */
|
||||
}
|
||||
/* STANDARD */
|
||||
}
|
||||
/* STANDARD */
|
||||
|
||||
.buttons_for_course a:hover{
|
||||
.buttons_for_course a:hover{
|
||||
background-color:#dff4ff;
|
||||
border:1px solid #c2e1ef;
|
||||
color:#336699;
|
||||
}
|
||||
.buttons_for_course a:active{
|
||||
}
|
||||
.buttons_for_course a:active{
|
||||
background-color:#6299c5;
|
||||
border:1px solid #6299c5;
|
||||
color:#fff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* REGULAR */
|
||||
/* REGULAR */
|
||||
|
||||
.buttons_for_course a.regular{
|
||||
.buttons_for_course a.regular{
|
||||
color:#ffffff;
|
||||
}
|
||||
.buttons_for_course a.regular:hover {
|
||||
}
|
||||
.buttons_for_course a.regular:hover {
|
||||
background-color:#dff4ff;
|
||||
border:1px solid #c2e1ef;
|
||||
color:#336699;
|
||||
}
|
||||
.buttons_for_course a.regular:active{
|
||||
}
|
||||
.buttons_for_course a.regular:active{
|
||||
background-color:#6299c5;
|
||||
border:1px solid #6299c5;
|
||||
color:#fff;
|
||||
}
|
||||
}
|
||||
|
||||
/* end */
|
||||
/* end */
|
||||
|
||||
.course-font {
|
||||
.course-font {
|
||||
color:#8c8a8a;
|
||||
}
|
||||
}
|
||||
|
||||
.teacher {
|
||||
.teacher {
|
||||
display: inline-block;
|
||||
word-spacing: 22px;
|
||||
width: 60px;
|
||||
text-justify:inter-ideograph;
|
||||
text-align: justify;
|
||||
}
|
||||
.brief_introduction {
|
||||
}
|
||||
.brief_introduction {
|
||||
margin-top: -18px;
|
||||
margin-left: 60px;
|
||||
/*display: inline-block;*/
|
||||
|
@ -2006,9 +2006,9 @@ div.avatar_user{
|
|||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* *
|
||||
*Designed for message.
|
||||
*/
|
||||
|
@ -2043,7 +2043,7 @@ ul.message-for-user li.outer-message-for-user {
|
|||
margin: 0px;
|
||||
padding: 0px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
span.body{
|
||||
float: left;
|
||||
|
@ -2054,17 +2054,17 @@ span.body{
|
|||
padding: 0px;
|
||||
display: block;
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
span.time{
|
||||
span.time{
|
||||
color: rgb(172,174,174);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.message-notes{
|
||||
.message-notes{
|
||||
max-width: 80%;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
ul.messages-for-user-reply li {
|
||||
padding-bottom: 4px;
|
||||
|
@ -2231,4 +2231,3 @@ ul.messages-for-user-reply li {
|
|||
.footer_text_link{
|
||||
margin: 0px 5px;
|
||||
}
|
||||
/*gcm*/
|
|
@ -124,3 +124,29 @@ courses_061:
|
|||
rgt:
|
||||
is_public: 0
|
||||
inherit_members: 1
|
||||
course_trustie_074:
|
||||
id: 74
|
||||
tea_id: 698
|
||||
name: 电路与电子学基础(软件工程专业)
|
||||
state:
|
||||
code:
|
||||
time: 2014
|
||||
extra: course2014-05-22_16-09-25
|
||||
created_at: 2014-05-22 08:09:25.000000000 Z
|
||||
updated_at: 2014-05-22 08:09:25.000000000 Z
|
||||
location:
|
||||
term: 春季学期
|
||||
string:
|
||||
password: '12345678'
|
||||
setup_time:
|
||||
endup_time:
|
||||
class_period: '54'
|
||||
school_id: 117
|
||||
description: "电路与电子学基础,软件工程小班\\r\ 模拟电子技术部分\ "
|
||||
status: 1
|
||||
attachmenttype: 2
|
||||
lft:
|
||||
rgt:
|
||||
is_public: 1
|
||||
inherit_members: 1
|
||||
|
||||
|
|
|
@ -1,68 +1,26 @@
|
|||
# encoding: utf-8
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
class CourseTest < ActiveSupport::TestCase
|
||||
fixtures :courses, :roles, :member_roles, :members, :boards, :messages, :news
|
||||
def setup
|
||||
@course_1 = Course.new
|
||||
@course_1.id = 1
|
||||
@course_1.tea_id = 1
|
||||
@course_1.name = 'course1'
|
||||
@course_1.state = 1234
|
||||
@course_1.time = 2012
|
||||
@course_1.term = '秋季学期'
|
||||
@course_1.password = 1234
|
||||
@course_1.class_period = 40
|
||||
|
||||
@course_2 = Course.new
|
||||
@course_2.id = 2
|
||||
@course_2.tea_id = 1
|
||||
@course_2.name = 'course2'
|
||||
@course_2.state = 1234
|
||||
@course_2.time = 2013
|
||||
@course_2.term = '秋季学期'
|
||||
@course_2.password = 1234
|
||||
@course_2.class_period = 40
|
||||
|
||||
@course_3 = Course.new
|
||||
@course_3.id = 3
|
||||
@course_3.tea_id = 1
|
||||
@course_3.name = 'course3'
|
||||
@course_3.state = 1234
|
||||
@course_3.time = 2014
|
||||
@course_3.term = '秋季学期'
|
||||
@course_3.password = 1234
|
||||
@course_3.class_period = 40
|
||||
|
||||
@course_now = Course.new
|
||||
@course_now.id = 4
|
||||
@course_now.tea_id = 1
|
||||
@course_now.name = 'course4'
|
||||
@course_now.state = 1234
|
||||
@course_now.time = 2013
|
||||
@course_now.term = '秋季学期'
|
||||
@course_now.password = 1234
|
||||
@course_now.class_period = 40
|
||||
end
|
||||
|
||||
test 'test course whether out of date.' do
|
||||
true
|
||||
test 'name valid with CJK coding' do
|
||||
course = Course.find_by_id(74)
|
||||
name_quirk = '电路与电子学基础(软件工程专业)'
|
||||
course.name = "test_course"
|
||||
assert course.valid?
|
||||
course.name = name_quirk
|
||||
assert course.valid?
|
||||
end
|
||||
|
||||
test 'description too long must be valid.' do
|
||||
course = Course.find_by_id(8)
|
||||
course.description = course.description * 100
|
||||
course.valid?
|
||||
assert_equal course.errors.full_messages.count, 0
|
||||
assert course.valid?
|
||||
end
|
||||
|
||||
def teardown
|
||||
|
|
Loading…
Reference in New Issue