Merge branch 'szzh' into develop

This commit is contained in:
sw 2015-07-18 15:16:11 +08:00
commit 13d9c31a12
25 changed files with 181 additions and 119 deletions

View File

@ -151,7 +151,7 @@ class HomeworkCommonController < ApplicationController
@homework.description = params[:homework_common][:description]
@homework.end_time = params[:homework_common][:end_time]
@homework.publish_time = params[:homework_common][:publish_time]
@homework.homework_type = params[:homework_common][:homework_type]
@homework.homework_type = params[:homework_common][:homework_type] if params[:homework_common][:homework_type]
unless @homework.late_penalty == params[:late_penalty]
@homework.student_works.where("created_at > '#{@homework.end_time} 23:59:59'").each do |student_work|
student_work.late_penalty = params[:late_penalty]

View File

@ -180,6 +180,7 @@ class MyController < ApplicationController
# Manage user's password
def password
begin
@act='password'
@user = User.current
unless @user.change_password_allowed?
@ -196,18 +197,20 @@ class MyController < ApplicationController
Token.delete_user_all_tokens(@user)
logout_user
redirect_to signin_url(back_url: my_account_path)
return
else
flash.now[:error] = l(:notice_account_wrong_password)
#flash.now[:error] = l(:notice_account_wrong_password)
end
end
render :template => 'my/account',:layout=>'base_users_new'
rescue Exception => e
if e.message == 'wrong password'
flash.now[:error] = l(:notice_account_wrong_password)
# flash.now[:error] = l(:notice_account_wrong_password)
else
flash.now[:error] = e.message
# flash.now[:error] = e.message
end
render :template => 'my/account',:layout=>'base_users_new'
flash.now[:error] = l(:notice_account_old_wrong_password)
end
render :template => 'my/account',:layout=>'base_users_new'
end
# Create a new feeds key

View File

@ -250,6 +250,14 @@ update
return -1
end
end
if params[:to] == 'gitlab'
g = Gitlab.client
g.post('/session', body: {email: User.current.mail, password: User.current.hashed_password})
redirect_to "http://192.168.41.130:3000/gitlab-org/gitlab-shell/tree/master"
return
end
#if( !User.current.member_of?(@project) || @project.hidden_repo)
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
@ -540,11 +548,12 @@ update
:stack => :side,
:scale_integers => true,
:step_x_labels => 2,
:show_data_values => false,
:show_data_values => true,
:graph_title => l(:label_commits_per_month),
:show_graph_title => true
)
# 具状图
graph.add_data(
:data => commits_by_month[0..11].reverse,
:title => l(:label_revision_plural)
@ -560,7 +569,7 @@ update
def graph_commits_per_author(repository)
commits_by_author = Changeset.count(:all, :group => :committer, :conditions => ["repository_id = ?", repository.id])
commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}
commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(25)
changes_by_author = Change.count(:all, :group => :committer, :include => :changeset, :conditions => ["#{Changeset.table_name}.repository_id = ?", repository.id])
h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o}
@ -582,7 +591,7 @@ update
:fields => fields,
:stack => :side,
:scale_integers => true,
:show_data_values => false,
:show_data_values => true,
:rotate_y_labels => false,
:graph_title => l(:label_commits_per_author),
:show_graph_title => true

View File

@ -13,8 +13,9 @@ class StudentWorkController < ApplicationController
def index
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
unless @group == "0" || @group.nil?
group_students = CourseGroup.find_by_id(@group).users
course_group = CourseGroup.find_by_id(@group) if @group
if course_group
group_students = course_group.users
if group_students.empty?
student_in_group = '(0)'
else

View File

@ -142,7 +142,7 @@ class UsersController < ApplicationController
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Project.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@list = query.order("#{Project.table_name}.updated_on desc,#{Project.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@params = params
respond_to do |format|
@ -281,7 +281,7 @@ class UsersController < ApplicationController
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Course.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@list = query.order("#{Course.table_name}.updated_at desc,#{Course.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@params = params
render :layout=>'base_users_new'
@ -460,14 +460,13 @@ class UsersController < ApplicationController
end
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("#{Course.table_name}.id < ?",params[:lastid])
query = query.where("( (#{Course.table_name}.updated_at=? and #{Course.table_name}.id < ?) or #{Course.table_name}.updated_at<?)",params[:lasttime],params[:lastid],params[:lasttime])
end
@list = query.order("#{Course.table_name}.id desc").limit(8).all
@list = query.order("#{Course.table_name}.updated_at desc,#{Course.table_name}.id desc").limit(8).all
render :layout=>nil
end
def user_projects4show
query = Project.joins("join members m on #{Project.table_name}.id=m.project_id")
query = query.where("m.user_id = ? and #{Project.table_name}.project_type=?",@user.id,Project::ProjectType_project)
if User.current == @user #看自己
@ -477,9 +476,9 @@ class UsersController < ApplicationController
end
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("#{Project.table_name}.id < ?",params[:lastid])
query = query.where("( (#{Project.table_name}.updated_on=? and #{Project.table_name}.id < ?) or #{Project.table_name}.updated_on<?)",params[:lasttime],params[:lastid],params[:lasttime])
end
@list = query.order("#{Project.table_name}.id desc").limit(8).all
@list = query.order("#{Project.table_name}.updated_on desc,#{Project.table_name}.id desc").limit(8).all
render :layout=>nil
end

View File

@ -2345,6 +2345,34 @@ module ApplicationHelper
#将文本内的/n转换为<br>
def text_format text
text.gsub("\n","<br/>").html_safe
text.gsub("&","&amp;").gsub("<","&lt;").gsub(">","&gt;").gsub("\n","<br/>").html_safe
end
#评分规则显示
def scoring_rules late_penalty,homework_id,is_teacher,absence_penalty=nil
if absence_penalty
if late_penalty.to_i == 0 && absence_penalty.to_i == 0
notice = "尚未设置评分规则"
if is_teacher
notice += ",请&nbsp" + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green")
end
elsif late_penalty.to_i != 0 && absence_penalty.to_i == 0
notice = "迟交扣#{late_penalty}分,缺评扣分未设置"
elsif late_penalty.to_i == 0 && absence_penalty.to_i != 0
notice = "迟交扣分未设置,缺评一个作品扣#{absence_penalty}"
elsif late_penalty.to_i != 0 && absence_penalty.to_i != 0
notice = "迟交扣#{late_penalty}分,缺评一个作品扣#{absence_penalty}"
end
else
if late_penalty.to_i == 0
notice = "尚未设置评分规则"
if is_teacher
notice += ",请&nbsp" + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green")
end
else
notice = "迟交扣#{late_penalty}"
end
end
notice.html_safe
end
end

View File

@ -53,31 +53,4 @@ module HomeworkCommonHelper
link
end
#评分规则显示
def scoring_rules late_penalty,homework_id,is_teacher,absence_penalty=nil
if absence_penalty
if late_penalty.to_i == 0 && absence_penalty.to_i == 0
notice = "尚未设置评分规则"
if is_teacher
notice += ",请&nbsp" + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green")
end
elsif late_penalty.to_i != 0 && absence_penalty.to_i == 0
notice = "迟交扣#{late_penalty}分,缺评扣分未设置"
elsif late_penalty.to_i == 0 && absence_penalty.to_i != 0
notice = "迟交扣分未设置,缺评一个作品扣#{absence_penalty}"
elsif late_penalty.to_i != 0 && absence_penalty.to_i != 0
notice = "迟交扣#{late_penalty}分,缺评一个作品扣#{absence_penalty}"
end
else
if late_penalty.to_i == 0
notice = "尚未设置评分规则"
if is_teacher
notice += ",请&nbsp" + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green")
end
else
notice = "迟交扣#{late_penalty}"
end
end
notice.html_safe
end
end

View File

@ -447,7 +447,9 @@ module UsersHelper
when "Issue"
return activity.act.subject
when "Journal"
return details_to_strings(activity.act.details,true).to_s
arr = details_to_strings(activity.act.details,true)
arr << activity.act.notes
return arr.to_s
when "JournalsForMessage"
return activity.act.notes
when "Message"

View File

@ -12,6 +12,8 @@ class UserExtensions < ActiveRecord::Base
belongs_to :user
belongs_to :school, :class_name => 'School', :foreign_key => :school_id
attr_accessible :user_id,:birthday,:brief_introduction,:gender,:location,:occupation,:work_experience,:zip_code,:identity, :technical_title,:student_id
validates_length_of :description, :maximum => 255
validates_length_of :brief_introduction, :maximum => 255
TEACHER = 0
STUDENT = 1
ENTERPRISE = 2

View File

@ -2,26 +2,29 @@
<% if file.is_public? || User.current.member_of_course?(course) %>
<div class="re_con_box" id="container_files_<%= file.id %>">
<div class="">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %>
<%= link_to truncate(file.filename,length: 35, omission: '...'),
download_named_attachment_path(file.id, file.filename),
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %>
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
<span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %>
</span>
<span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %>
</span>
<% else %>
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
<% end %>
<% else %>
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% end %>
<%= file_preview_tag(file, class: 'f_l re_open') %>
<% else %>
<% end %>
</div>
<div class="cl"></div>
<div class="">
<div class="mt5">
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
<%= link_to( l(:button_delete), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>

View File

@ -98,7 +98,7 @@
<li>
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
<a class="icon_remove" href="javascript:void(0);" title="删除测试" onclick="remove_programing_test($(this).parent().parent())"></a>
<span class="green_btn fl ml5 mt1">测试</span>
<!--span class="green_btn fl ml5 mt1">测试</span-->
</li>
<div class="cl"></div>
</div>
@ -116,7 +116,7 @@
<li>
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
<a class="icon_remove" href="javascript:void(0);" title="删除测试" onclick="remove_programing_test($(this).parent().parent())"></a>
<span class="green_btn fl ml5 mt1">测试</span>
<!--span class="green_btn fl ml5 mt1">测试</span-->
</li>
<div class="cl"></div>
</div>

View File

@ -15,7 +15,7 @@
<% hidden_non_project = Setting.find_by_name("hidden_non_project")
visiable = hidden_non_project && hidden_non_project.value == "0"%>
<% if @show_course == 1 && !visiable %>
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<%# if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<% hasCourse=false %>
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
@ -34,7 +34,7 @@
</ul>
</li>
<% end %>
<% end -%>
<%# end -%>
<% end %>
<% if User.current.projects.count>0 %>
@ -47,6 +47,7 @@
</ul>
</li>
<% end %>
<li><a href="<%= url_for(:controller => 'my', :action => 'account') %>">编辑资料</a></li>
<!--<li><a href="javascript:void(0);" class="parent">我的课程</a>-->
<!--<ul>-->
<!--<li><a href="javascript:void(0);">新建课程</a></li>-->

View File

@ -183,9 +183,9 @@ $(".subNav").click(function(){
<% end %>
<% if (@user.user_extensions.identity == 0 || @user.user_extensions.identity == 1) && !@user.user_extensions.school.nil? %>
<li><a href="<%= url_for(:controller=>'welcome',:action => 'course', :school_id => @user.user_extensions.school.id,:host=>Setting.host_course) %>"><%= @user.user_extensions.school.name %></a></li>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.user_extensions.school.name %>"><a href="<%= url_for(:controller=>'welcome',:action => 'course', :school_id => @user.user_extensions.school.id,:host=>Setting.host_course) %>"><%= @user.user_extensions.school.name %></a></li>
<% elsif @user.user_extensions.identity == 3 && !@user.user_extensions.occupation.nil? && !@user.user_extensions.occupation.empty? %>
<li><%= @user.user_extensions.occupation %></li>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.user_extensions.occupation %>"><%= @user.user_extensions.occupation %></li>
<% elsif @user.user_extensions.identity == 2 %>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
<% end %>

View File

@ -17,15 +17,15 @@
<div class="users_dis" id="users_tbc_01">
<% if( @act.nil? || @act != 'password') %>
<%= render_flash_messages %>
<%= error_messages_for 'user' %>
<%= error_messages_for 'user',@user.user_extensions %>
<% end %>
<ul class="setting_left">
<li>登录名&nbsp;:&nbsp;</li>
<li>邮箱&nbsp;:&nbsp;</li>
<li>登录名&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li>邮箱&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li>身份&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">姓氏&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">名字&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_2="true" style="display:none;">组织名&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">姓氏&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">名字&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li nhname="tag" nh_tag_2="true" style="display:none;">组织名&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">性别&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">工作单位&nbsp;:&nbsp;</li>
<li>地区&nbsp;:&nbsp;</li>
@ -35,8 +35,8 @@
<li>&nbsp;&nbsp;</li>
</ul>
<ul class="setting_right ">
<li><%= f.text_field :login,:no_label=>true, :required => true, :name => "login",:class=>"w210"%></li>
<li><%= f.text_field :mail,:no_label=>true, :required => true,:class=>"w210"%></li>
<li><%= f.text_field :login,:no_label=>true, :required => true, :nh_required=>"1", :name => "login",:class=>"w210"%></li>
<li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%></li>
<li>
<select onchange="showtechnical_title(this.value);" name="identity" id="userIdentity" class="location" class="w70" style="height:28px;margin-left:2px;">
@ -68,9 +68,9 @@
</span>
</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :lastname,:no_label=>true, :required => true,:class=>"w210" %>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :firstname,:no_label=>true, :required => true,:class=>"w210" %>
<li nhname="tag" nh_tag_2="true" style="display:none;"><%= text_field_tag :enterprise_name,@user.firstname,:no_label=>true, :required => true,:class=>"w210" %>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :lastname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
<li nhname="tag" nh_tag_2="true" style="display:none;"><%= text_field_tag :enterprise_name,@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<select class="w70" style="height:28px;margin-left:2px;" id="gender" name="gender"><option value="0">男</option><option value="1">女</option></select>
</li>
@ -85,7 +85,7 @@
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>
<% elsif User.current.user_extensions.school.nil? %>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w70" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;width:130px;" class="w70" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" />
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>
<% else %>
@ -141,11 +141,11 @@
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
<label>不要发送对我自己提交的修改的通知<%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style=>"height:14px;" %></label>
</li>
<li><input name="brief_introduction" class="w450" type="text" value="<%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></li>
<li style="height:auto;"><textarea name="description" class="w450 h200" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li>
<li><input name="brief_introduction" class="w450" type="text" maxlength="255" value="<%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></li>
<li style="height:auto;"><textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li>
<li style="display:none;"><%= f.select :language, :Chinese => :zh, :English => :en %></li>
<li class="ml2">
<a href="javascript:$('#my_account_form_btn').click();" class="blue_btn fl">确认</a>
<a href="javascript:;" id="my_account_form_link" class="blue_btn fl">确认</a>
<input type="submit" id="my_account_form_btn" style="display:none;"/>
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
</li>
@ -153,6 +153,7 @@
<div class="cl"></div>
</div><!--tbc_01 end-->
<% end %>
<%= form_tag({:action => "password"},:id => 'my_password_form') do %>
<div class="users_undis" id="users_tbc_02">
<% if( !@act.nil? && @act == 'password') %>
@ -165,11 +166,11 @@
<li>确认密码&nbsp;:&nbsp;</li>
</ul>
<ul class="setting_right ">
<li><input id="password" name="password" class="w210" type="password" required="true"></li>
<li><input id="new_password" name="new_password" class="w210" type="password" required="true"><span class="c_red ml5">请输入6-12个字符</span></li>
<li><input id="new_password_confirmation" name="new_password_confirmation" class="w210" type="password" required="true"></li>
<li><input id="password" name="password" class="w210" type="password" required="true" nh_required="1"></li>
<li><input id="new_password" name="new_password" class="w210" type="password" required="true" nh_required="1"><span class="c_red ml5">请输入6-12个字符</span></li>
<li><input id="new_password_confirmation" name="new_password_confirmation" class="w210" type="password" required="true" nh_required="1"></li>
<li class="ml2">
<a href="javascript:$('#my_password_form_btn').click();" class="blue_btn fl">确认</a>
<a href="javascript:;" id="my_password_form_link" class="blue_btn fl">确认</a>
<input type="submit" id="my_password_form_btn" style="display:none;"/>
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
</li>
@ -414,8 +415,15 @@
}
}
function showtechnical_title(val){
$("*[nhname='tag']").hide();
$("*[nh_tag_"+val+"='true']").show();
$("*[nhname='tag']").each(function(){
$("*[nh_required='1']",$(this)).attr("required",false);
$(this).hide()
});
$("*[nh_tag_"+val+"='true']").each(function(){
$("*[nh_required='1']",$(this)).attr("required",true);
$(this).show()
});
}
function init_identity_and_title(pField, identity, cField, title, language) {
for (var i = 0; i < pField.options.length; i++) {
@ -528,6 +536,12 @@
<% if( !@act.nil? && @act == 'password') %>
$("#users_tb_2").click();
<% end %>
$('#my_account_form_link').click(function(){
$('#my_account_form_btn').click();
});
$('#my_password_form_link').click(function(){
$('#my_password_form_btn').click();
});
});
</script>
<script type="text/javascript">

View File

@ -4,7 +4,7 @@
<p>
<%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
</p>
<p>
<p style="padding-top: 50px;">
<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
</p>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>

View File

@ -48,9 +48,9 @@
<%= link_to "所有作品(<span class='c_red'>#{@stundet_works.count}</span>)".html_safe,student_work_index_path(:homework => @homework.id), :class => "fl"%>
</span>
<% if @show_all%>
<input type="text" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName($(this).val(),$(this).next().val(),'<%= student_work_index_path(:homework => @homework.id)%>',event);">
<%= select_tag(:late_penalty,options_for_select(course_group_list(@course),@group), {:class => "fl h22 w100 ml10"}) if @is_teacher %>
<a class="student_work_search fl" onclick="SearchByName_1($(this).prev().prev().val(),$(this).prev().val(),'<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);">
<%= select_tag(:late_penalty,options_for_select(course_group_list(@course),@group), {:class => "fl h22 w100 ml10"}) if(@is_teacher && course_group_list(@course).count > 0) %>
<a class="student_work_search fl" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
<%= link_to("缺评情况",student_work_absence_penalty_student_work_index_path(:homework => @homework.id), :class => "student_work_search fl", :target => "_blank") if((@is_teacher || User.current.admin?) && @homework.homework_type == 1) %>
<% end%>
<% if @is_teacher%>
@ -165,15 +165,10 @@
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>
<div class="fl mb5 c_red">
迟交扣
<%= @homework.late_penalty%>
<% if @homework.homework_type == 1%>
,缺评一个作品扣
<%= @homework.homework_detail_manual.absence_penalty%>
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%>
<% else%>
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%>
<% end%>
</div>
</div>

View File

@ -38,9 +38,9 @@
<% if(course_end_flag) %>
<span class="grey_n_btn fr mt20">课程结束</span>
<% elsif(can_edit_flag) %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'new',:course=>item.id, :host=>Setting.host_course)%>" class="blue_n_btn fr mt20">发布作业</a>
<a href="<%=url_for(:controller => 'homework_common', :action => 'new',:course=>item.id, :host=>Setting.host_course)%>" target="_blank" class="blue_n_btn fr mt20">发布作业</a>
<% else %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>" class="blue_n_btn fr mt20">提交作品</a>
<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>" target="_blank" class="blue_n_btn fr mt20">提交作品</a>
<% end %>
<div class="cl"></div>
</div>

View File

@ -36,14 +36,14 @@
<p nhname='contentmsg'></p>
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:3px;">取消</a>
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:3px;">发布</a>
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:3px;">留言</a>
</form>
</div>
<div class="cl"></div>
<div class="message_list_box" nhname="list_more_div" id="nh_messages" style="display:none;">
<div nhname="container" data-nodatamsg="暂无留言" data-pagesize="3" data-url="<%= url_for(:controller => 'users', :action => 'user_feedback4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="message_list_more">
<div class="message_list_more" style="width:700px">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr mr10">收起</a>
<div class="cl"></div>
</div>
@ -273,6 +273,10 @@
if($("div[nhname='rec']",p.container).length > 0){
var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id');
url += "?lastid="+lastid;
var lasttime = $("div[nhname='rec']",p.container).filter(':last').data('time');
if(lasttime != undefined){
url += "&lasttime="+lasttime;
}
}
$.ajax( {url:url,dataType:'text',success:function(data){
var html = $("<div>"+data+"</div>");

View File

@ -1,6 +1,6 @@
<% for item in @list %>
<div class="home_courses_list fl" nhname="rec" data-id="<%= item.id %>">
<div class="home_courses_list fl" nhname="rec" data-id="<%= item.id %>" data-time="<%= item.updated_at %>">
<div class="courses_list_pic fl ml10 mr10">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>"><%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %></a>
</div>

View File

@ -43,7 +43,7 @@
</tbody></table>
</div>
</div>
<a href="<%= url_for(:controller => 'issues', :action=>"new", :project_id=>item.id, :host=>Setting.host_name) %>" class="blue_n_btn fr mt20">发布问题</a>
<a href="<%= url_for(:controller => 'issues', :action=>"new", :project_id=>item.id, :host=>Setting.host_name) %>" target="_blank" class="blue_n_btn fr mt20">发布问题</a>
<div class="cl"></div>
</div>
<% end %>

View File

@ -1,5 +1,5 @@
<% for item in @list %>
<div class="home_courses_list fl" nhname="rec" data-id="<%= item.id %>">
<div class="home_courses_list fl" nhname="rec" data-id="<%= item.id %>" data-time="<%= item.updated_on %>">
<div class="courses_list_pic fl ml10 mr10">
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>"><%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %></a>
</div>

View File

@ -6,7 +6,7 @@
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<div class="recall_head">
<% if show_name %>
<%= image_tag url_to_avatar(journal.user),:width => '30',:height => '30' %>
<%= image_tag url_to_avatar(reply.user),:width => '30',:height => '30' %>
<% else %>
<%= image_tag url_to_avatar(nil),:width => '30',:height => '30' %>
<% end %>

View File

@ -31,9 +31,11 @@ zh:
label_account_identity_developer: 开发者
label_account_identity_enterprise: 组织
label_account_identity_studentID: 请输入学号
field_brief_introduction_my: 个人签名
field_description: 个人简介
field_is_required: 必填
field_firstname: 名字
field_firstname: 名字或组织名
firstname_empty: 名字不能为空
field_firstname_eg: '(例:张三丰,请填写[三丰])'
field_lastname: 姓氏

View File

@ -7,8 +7,29 @@ zh:
direction: ltr
jquery:
locale: "zh-CN"
date:
formats:
# Use the strftime parameters for formats.
# When no format has been given, it uses default.
# You can provide other formats here if you like!
default: "%Y-%m-%d"
short: "%b%d日"
long: "%Y年%b%d日"
day_names: [星期天, 星期一, 星期二, 星期三, 星期四, 星期五, 星期六]
abbr_day_names: [日, 一, 二, 三, 四, 五, 六]
# Don't forget the nil at the beginning; there's no such thing as a 0th month
month_names: [~, 一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月]
abbr_month_names: [~, 1月, 2月, 3月, 4月, 5月, 6月, 7月, 8月, 9月, 10月, 11月, 12月]
# Used in date_select and datime_select.
order:
- :year
- :month
- :day
notice_account_updated: 帐号更新成功
notice_account_old_wrong_password: 原始密码错误
notice_account_wrong_password: 密码错误
name_can_be_empty: 可以不填写真实姓名[保密所需]
notice_successful_create: 创建成功
@ -265,9 +286,9 @@ zh:
permission_view_gantt: 查看甘特图
permission_view_calendar: 查看日历
permission_view_issue_watchers: 查看跟踪者列表
permission_add_issue_watchers: 添加跟踪者
permission_delete_issue_watchers: 删除跟踪者
permission_log_time: 登记工时
@ -636,7 +657,7 @@ zh:
label_comment_add: 添加评论
label_comment_added: 评论已添加
label_comment_delete: 删除评论
@ -1200,9 +1221,9 @@ zh:
label_post_on: 发表了
label_post_on_issue: 发表了问题
label_updated_time_on: " 更新于 %{value} "
label_call_list: 需求列表
@ -1513,9 +1534,9 @@ zh:
label_news_number: 新闻的数量
label_wiki_number: wiki的数量
label_wiki_mail_notification: 发布了wiki
# redmine活跃度评分
label_message_number: 留言的数量 # delete
label_activity_number: 个人动态数量 # delete
@ -1525,14 +1546,14 @@ zh:
label_wiki_number: wiki的数量 # delete
label_activities: 个人动态
label_issue_message_number: 对issue的留言数量
label_code_submit_number: 代码提交次数
label_topic_number: 讨论区发言数量
label_join_contest: 加入竞赛
label_exit_contest: 退出竞赛
label_participator: 参与者
@ -1627,7 +1648,7 @@ zh:
label_bid_contest_show_course_name: 课程名称
label_bid_contest_show_teacher_name: 教师
label_contest_list: 竞赛列表
label_bids_task_list: 作业列表
@ -1958,9 +1979,9 @@ zh:
label_poll_republish_success: 取消成功
label_answer_total: 总计:
label_join_project: 加入项目
#
#
# 项目企业模块

View File

@ -861,14 +861,19 @@ function clickOK(path)
});
}
//查询
function SearchByName(name,group,url,event)
function SearchByName(url,event)
{
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
location.href = url + "&name=" + name + "&group=" + group;
location.href = url + "&name=" + $("#course_student_name").val() + "&group=" + $("#late_penalty").val();
}
}
function SearchByName_1(name,group,url)
function SearchByName_1(url)
{
location.href = url + "&name=" + name + "&group=" + group;
if($("#late_penalty").val() == null){
location.href = url + "&name=" + $("#course_student_name").val()
}
else{
location.href = url + "&name=" + $("#course_student_name").val() + "&group=" + $("#late_penalty").val();
}
}