Merge branch 'szzh' into develop

This commit is contained in:
sw 2015-07-24 15:19:36 +08:00
commit caec634e4c
30 changed files with 334 additions and 173 deletions

View File

@ -4,56 +4,50 @@ module Mobile
include Redmine::I18n
def self.course_dynamic_expose(field)
expose field do |c,opt|
if field == :update_time
(format_time(c[field]) if (c.is_a?(Hash) && c.key?(field)))
elsif field == :news_count
obj = nil
c[:dynamics].each do |d|
if d[:type] == 1
obj = d[:count]
end
end
obj
elsif field == :document_count
obj = nil
c[:dynamics].each do |d|
if d[:type] == 3
obj = d[:count]
end
end
obj
elsif field == :topic_count
obj = nil
c[:dynamics].each do |d|
if d[:type] == 2
obj = d[:count]
end
end
obj
elsif field == :homework_count
obj = nil
c[:dynamics].each do |d|
if d[:type] == 4
obj = d[:count]
end
end
obj
else
# if field == :news_count
# obj = nil
# c[:dynamics].each do |d|
# if d[:type] == 1
# obj = d[:count]
# end
# end
# obj
# elsif field == :document_count
# obj = nil
# c[:dynamics].each do |d|
# if d[:type] == 3
# obj = d[:count]
# end
# end
# obj
# elsif field == :topic_count
# obj = nil
# c[:dynamics].each do |d|
# if d[:type] == 2
# obj = d[:count]
# end
# end
# obj
# elsif field == :homework_count
# obj = nil
# c[:dynamics].each do |d|
# if d[:type] == 4
# obj = d[:count]
# end
# end
# obj
# else
c[field] if (c.is_a?(Hash) && c.key?(field))
end
# end
end
end
course_dynamic_expose :type
course_dynamic_expose :count
course_dynamic_expose :course_name
course_dynamic_expose :course_term
course_dynamic_expose :course_time
course_dynamic_expose :course_id
course_dynamic_expose :course_img_url
course_dynamic_expose :message
course_dynamic_expose :update_time
course_dynamic_expose :count
course_dynamic_expose :news_count
course_dynamic_expose :document_count
course_dynamic_expose :topic_count
@ -63,62 +57,32 @@ module Mobile
course_dynamic_expose :current_user_is_member
course_dynamic_expose :current_user_is_teacher
expose :documents,using:Mobile::Entities::Attachment do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 3
obj = d[:documents]
end
end
obj
end
# expose :documents,using:Mobile::Entities::Attachment do |f,opt|
# obj = nil
# f[:dynamics].each do |d|
# if d[:type] == 3
# obj = d[:documents]
# end
# end
# obj
# end
expose :topics,using:Mobile::Entities::Message do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 2
obj = d[:topics]
end
end
obj
f[:topics]
end
expose :homeworks,using:Mobile::Entities::Homework do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 4
obj = d[:homeworks]
end
end
obj
f[:homeworks]
end
expose :news,using:Mobile::Entities::News do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 1
obj = d[:news]
end
end
obj
f[:news]
end
expose :better_students,using:Mobile::Entities::User do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 6
obj = d[:better_students]
end
end
obj
f[:better_students]
end
expose :active_students,using:Mobile::Entities::User do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 7
obj = d[:active_students]
end
end
obj
f[:active_students]
end
end

View File

@ -604,7 +604,7 @@ class CoursesController < ApplicationController
def toggleCourse
@course_prefs = Course.find_by_extra(@course.extra)
unless (@course_prefs.student != User.current || User.current.admin?)
unless (User.current.allowed_to?(:as_teacher,@course_prefs) || User.current.admin?)
render_403
end
end

View File

@ -144,6 +144,8 @@ class HomeworkCommonController < ApplicationController
end
if homework.save
homework_detail_programing.save if homework_detail_programing
homework_detail_manual.save if homework_detail_manual
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_create)
@ -254,7 +256,6 @@ class HomeworkCommonController < ApplicationController
client.request(request)
end
result = JSON.parse(res.body)
homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0
end
@homework.save_attachments(params[:attachments])

View File

@ -71,13 +71,12 @@ class NewsController < ApplicationController
scope = @course ? @course.news.course_visible : News.course_visible
@news_count = scope.count
#@news_pages = Paginator.new @news_count, @limit, params['page']
#@offset ||= scope_page.offset
@q = params[:subject]
if params[:subject].nil?
scope_order = scope.all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")
else
scope_order = scope.where("news.title like '#{'%' << params[:subject].to_s << '%'}'").all(:include => [:author, :course],
scope_order = scope.where("#{News.table_name}.title like '#{'%' << params[:subject].to_s << '%'}'").all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")
end

View File

@ -459,6 +459,12 @@ update
data = graph_commits_per_month(@repository)
when "commits_per_author"
data = graph_commits_per_author(@repository)
when "author_commits_per_month"
data = graph_author_commits_per_month(@repository)
when "author_commits_six_month"
data = author_commits_six_month(@repository)
when "author_qoc_per_author"
data = graph_author_qoc_per_author(@repository)
end
if data
headers["Content-Type"] = "image/svg+xml"
@ -617,6 +623,80 @@ update
)
graph.burn
end
# 用户每月提交次数
def graph_author_commits_per_month(repository)
@date_to = Date.today
@date_from = @date_to << 1
@date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day)
commits_by_author = Changeset.count(:all, :group => :committer,
:conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40)
fields = commits_by_author.collect {|r| r.first}
commits_data = commits_by_author.collect {|r| r.last}
fields = fields + [""]*(10 - fields.length) if fields.length<10
commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
# Remove email adress in usernames
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
graph = SVG::Graph::BarHorizontal.new(
:height => 400,
:width => 600,
:fields => fields,
:stack => :side,
:scale_integers => true,
:show_data_values => true,
:rotate_y_labels => false,
:graph_title => l(:label_author_commits_per_month),
:show_graph_title => true
)
graph.add_data(
:data => commits_data,
:title => l(:label_revision_plural)
)
graph.burn
end
# 用户最近六个月的提交次数
def author_commits_six_month(repository)
@date_to = Date.today
@date_from = @date_to << 6
@date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day)
commits_by_author = Changeset.count(:all, :group => :committer,
:conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40)
fields = commits_by_author.collect {|r| r.first}
commits_data = commits_by_author.collect {|r| r.last}
fields = fields + [""]*(10 - fields.length) if fields.length<10
commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
# Remove email adress in usernames
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
graph = SVG::Graph::BarHorizontal.new(
:height => 400,
:width => 600,
:fields => fields,
:stack => :side,
:scale_integers => true,
:show_data_values => true,
:rotate_y_labels => false,
:graph_title => l(:label_author_commits_six_month),
:show_graph_title => true
)
graph.add_data(
:data => commits_data,
:title => l(:label_revision_plural)
)
graph.burn
end
def check_hidden_repo
project = Project.find(params[:id])
if !User.current.member_of?(project)

View File

@ -1,5 +1,11 @@
# encoding: utf-8
module ApiHelper
ONE_MINUTE = 60 * 1000
ONE_HOUR = 60 * ONE_MINUTE
ONE_DAY = 24 * ONE_HOUR
ONE_MONTH = 30 * ONE_DAY
ONE_YEAR = 12 * ONE_MONTH
#获取用户的工作单位
def get_user_work_unit user
work_unit = ""
@ -163,5 +169,37 @@ module ApiHelper
end
# 获取当前时间
def time_from_now time
lastUpdateTime = time.to_i*1000
currentTime = Time.now.to_i*1000
timePassed = currentTime - lastUpdateTime;
timeIntoFormat = 0
updateAtValue = ""
if timePassed < 0
updateAtValue = "时间有问题"
elsif timePassed < ONE_MINUTE
updateAtValue = "一分钟前"
elsif timePassed < ONE_HOUR
timeIntoFormat = timePassed / ONE_MINUTE
updateAtValue = timeIntoFormat.to_s + "分钟前"
elsif (timePassed < ONE_DAY)
timeIntoFormat = timePassed / ONE_HOUR
updateAtValue = timeIntoFormat.to_s + "小时前"
elsif (timePassed < ONE_MONTH)
timeIntoFormat = timePassed / ONE_DAY
updateAtValue = timeIntoFormat.to_s + "天前"
elsif (timePassed < ONE_YEAR)
timeIntoFormat = timePassed / ONE_MONTH
updateAtValue = timeIntoFormat.to_s + "个月前"
else
timeIntoFormat = timePassed / ONE_YEAR
updateAtValue = timeIntoFormat.to_s + "年前"
end
updateAtValue
end
end

View File

@ -38,7 +38,7 @@ module MembersHelper
scope = []
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5')
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true
}

View File

@ -236,13 +236,14 @@ module RepositoriesHelper
# 判断项目是否有主版本库
def judge_main_repository(pro)
if pro.repositories.blank?
return false
status = false
else
pro.repositories.sort.each do |rep|
rep.is_default?
return true
pro.repositories.each do |rep|
status = true and break if rep.is_default?
status = false
end
end
status
end
# def cvs_field_tags(form, repository)
# content_tag('p', form.text_field(

View File

@ -654,36 +654,42 @@ class CoursesService
return
end
if current_user == @user || current_user.admin?
membership = @user.coursememberships.page(1).per(15)
membership = @user.coursememberships
else
membership = @user.coursememberships.page(1).per(15).all(:conditions => Course.visible_condition(current_user))
membership = @user.coursememberships.all(:conditions => Course.visible_condition(current_user))
end
if membership.nil? || membership.count == 0
raise l(:label_no_courses, :locale => get_user_language(current_user))
end
membership.sort! { |older, newer| newer.created_on <=> older.created_on }
#membership.sort! { |older, newer| newer.created_on <=> older.created_on }
#定义一个数组集合存放hash数组该hash数组包括课程的信息并包含课程的最新发布的资源最新的讨论区留言最新的作业最新的通知
result = []
#对用户所有的课程进行循环,找到每个课程最新发布的资源,最新的讨论区留言,最新的作业,最新的通知,并存进数组
membership.each do |mp|
course = mp.course
latest_course_dynamics = []
notices_count = 0
topic_count = 0
topics = nil
homeworkss = nil
notices = nil
# 课程通知
latest_news = course.news.page(1).per(2).order("created_on desc")
unless latest_news.first.nil?
latest_course_dynamics << {:type => 1, :time => latest_news.first.created_on,:count=>course.news.count,
:news => latest_news.all}
notices_count = course.news.count
notices = latest_news.all
latest_course_dynamics << {:time => latest_news.first.created_on }
end
# 课程讨论区
latest_message = course.boards.first.topics.page(1).per(2)
unless latest_message.first.nil?
latest_course_dynamics << {:type => 2, :time => latest_message.first.created_on, :count =>course.boards.nil? ? 0 : course.boards.first.topics.count,
:topics => latest_message.all}
topic_count = course.boards.nil? ? 0 : course.boards.first.topics.count
topics = latest_message.all
latest_course_dynamics << {:time => latest_message.first.created_on}
end
# 课程资源
# latest_attachment = course.attachments.order("created_on desc").page(1).per(2)
# unless latest_attachment.first.nil?
@ -694,14 +700,17 @@ class CoursesService
#课程作业 已经交的学生列表暂定显示6人未交的学生列表作业的状态
homeworks = course.homework_commons.page(1).per(2).order('created_at desc')
unless homeworks.first.nil?
latest_course_dynamics << {:type => 4, :time => homeworks.first.updated_at, :count=>course.homework_commons.count , :homeworks => homeworks}
homeworkss = homeworks
latest_course_dynamics << {:time => homeworks.first.updated_at}
end
latest_course_dynamics.sort! { |order, newer| newer[:time] <=> order[:time] }
# 课程学霸 学生总分数排名靠前的5个人
homework_count = course.homework_commons.count
sql = "select users.*,ROUND(sum(student_works.final_score),2) score from student_works left outer join users on student_works.user_id = users.id" <<
" where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{course.id}) GROUP BY student_works.user_id ORDER BY score desc limit 0,4"
better_students = User.find_by_sql(sql)
# 找出在课程讨论区发帖回帖数最多的
active_students = []
sql1 = " select users.*,count(author_id)*2 active_count from messages " <<
@ -710,20 +719,41 @@ class CoursesService
" GROUP BY messages.author_id ORDER BY count(author_id) desc " <<
" limit 0,4"
active_students = User.find_by_sql(sql1)
if homework_count != 0 && !better_students.empty?
latest_course_dynamics <<{:type=> 6,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:better_students=> better_students}
latest_course_dynamics <<{:time=>"1970-01-01 0:0:0 +0800"}
end
unless active_students.empty?
latest_course_dynamics <<{:type=> 7,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:active_students=>active_students}
latest_course_dynamics <<{:time=>"1970-01-01 0:0:0 +0800"}
end
latest_course_dynamic = latest_course_dynamics.first
unless latest_course_dynamic.nil?
result << {:course_name => course.name,:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course), :course_id => course.id, :course_img_url => url_to_avatar(course), :course_time => course.time, :course_term => course.term,:message => "", :dynamics => latest_course_dynamics,
:course_student_num=>course ? course.members.count : 0,:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "",:time=>latest_course_dynamic[:time].to_time}
result << {:course_name => course.name,
:current_user_is_member => current_user.member_of_course?(course),
:current_user_is_teacher => is_course_teacher(current_user,course),
:course_id => course.id,
:course_img_url => url_to_avatar(course),
:course_time => course.time,
:course_term => course.term,
:news_count => notices_count,
:homework_count => homework_count,
:topic_count => topic_count,
:news => notices,
:homeworks => homeworkss,
:topics => topics,
:better_students => better_students,
:active_students => active_students,
:message => "",
:course_student_num=>course ? course.members.count : 0,
#:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "前",
:time_from_now=>time_from_now(latest_course_dynamic[:time].to_time), #.strftime('%Y-%m-%d %H:%M:%S').to_s,
:time=>latest_course_dynamic[:time].to_time}
end
end
#返回数组集合
result.sort! { |order, newer| newer[:time] <=> order[:time] }
result
end

View File

@ -9,7 +9,7 @@
<div class="box tabular">
<p>
<label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label>
<%= text_field_tag 'mail', nil, :size => 40 %>
<%= text_field_tag 'mail', nil, :size => 40, :placeholder => '请输入注册邮箱'%>
<%= submit_tag l(:button_submit) %>
</p>
</div>

View File

@ -43,7 +43,7 @@
<div id="upload_progressbar" style="height:14px; margin-bottom: 10px;display: block"></div>
</div>
</span>
<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "btn_addPic", :style => "text-decoration:none;" %>
<%= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "btn_addPic", :style => "text-decoration:none;" %>
<a href="javascript:void(0);" class="btn_addPic" style="text-decoration:none;">
<span><%= l(:button_upload_photo) %></span>
</a>

View File

@ -71,18 +71,30 @@
<% end%>
</tbody>
</table>
<% end%>
<div class="cl"></div>
<div class="cl"></div>
<div class="mt5">
<% unless homework.attachments.empty?%>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 开发语言:</span>
<div class="fl">
<% if homework.homework_detail_programing.language.to_i == 1%>
C
<% elsif homework.homework_detail_programing.language.to_i == 2%>
C++
<% end%>
</div>
</div>
<div class="cl"></div>
<% end%>
<% unless homework.attachments.empty?%>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 附件:</span>
<div class="fl mb5">
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework.attachments} %>
</div>
<% end%>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
<% end%>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>

View File

@ -80,11 +80,13 @@
<div class="cl"></div>
<div>
<% if @project.project_type == 0 %>
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
<%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id}, :class => "c_orange f14" ) %>
<% unless project_scores(@project) == 0 %>
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
<%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id}, :class => "c_orange f14" ) %>
<% end %>
<% end %>
</div>

View File

@ -41,7 +41,7 @@
<div id="LSide" class="fl">
<div class="users_info">
<div class="pic_head">
<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>
<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:214px;height:214px;overflow:hidden",:alt=>"头像") %>
<% if @center_flag %>
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="pic_edit usersphoto_edit"></a>
<% end %>
@ -71,7 +71,7 @@
<div class="leftbox mt10">
<ul class="leftbox_ul_left">
<li>加入时间&nbsp;:</li>
<li>最近登录&nbsp;:</li> <!--加入时间修改为最近登录 -->
<% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %>
<li><%= l(:label_company_name) %>&nbsp;:</li>
<% elsif !@user.firstname.empty? || !@user.lastname.empty? %>
@ -99,7 +99,7 @@
<% end %>
</ul>
<ul class="leftbox_ul_right c_dgrey">
<li><%= format_date(@user.created_on) %></li>
<li><%= format_date(@user.last_login_on) %></li> <!-- 加入时间修改为最近登录时间-->
<% if @user.user_extensions.identity == 0 %>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
<% end %>
@ -247,7 +247,7 @@
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr2"> 取&nbsp;&nbsp;消</a>
<a href="javascript:hideModal();" class=" fr grey_btn mr15"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->

View File

@ -1,4 +1,9 @@
<% if @project%>
var checked = $("#principals input:checked").size();
if(checked > 0)
{
alert('翻页或搜索后将丢失当前选择的用户数据!');
}
<% if @flag == "true"%>
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
<% else%>

View File

@ -540,6 +540,7 @@
$('#my_account_form_btn').click();
});
$('#my_password_form_link').click(function(){
// alert("密码修改成功,请重新登录!");
$('#my_password_form_btn').click();
});
});

View File

@ -4,4 +4,5 @@
$('#ajax-modal').siblings().hide();
$('#ajax-modal').parent().removeClass("alert_praise");
//$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");
$('#ajax-modal').parent().addClass("alert_box");
$('#ajax-modal').parent().css("border", "2px solid #15bccf").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0");

View File

@ -1,2 +1,2 @@
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>');
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:214px;height:214px;overflow:hidden",:alt=>"头像") %>');
hideModal();

View File

@ -24,8 +24,8 @@
<% end %>
</div>
<div class="problem_search fr" >
<%= form_tag({:controller => 'news', :action => 'index', :course_id => @course },:remote=>'true', :method => :get,:id=>"news_query_form", :class => 'query_form') do %>
<input class="problem_search_input fl" id="v_subject" placeholder="通知主题" type="text" name="subject" value="" onkeypress="" onkeydown="">
<%= form_tag({:controller => 'news', :action => 'index', :course_id => @course }, :method => :get,:id=>"news_query_form", :class => 'query_form') do %>
<input class="problem_search_input fl" id="v_subject" placeholder="通知主题" type="text" name="subject" value="<%= @q%>" onkeypress="" onkeydown="">
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_search();" >搜索</a>
<% end %>
</div><!--problem_search end-->
@ -34,7 +34,7 @@
<div id="news_list">
<%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %>
<div>
</div>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %>

View File

@ -69,12 +69,12 @@
}
</script>
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();", :style => "float:left" %>
<%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => "regexName();" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <!--修改项目搜索按钮的样式 -->
<!-- <a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
</a> -->
<br />
<span id="project_name_span" style="float: left"></span>
</div>

View File

@ -7,7 +7,23 @@
<%= 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 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 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 => "author_commits_per_month")) %>
</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 => "author_qoc_per_author")) %>
</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 => "author_commits_six_month")) %>
</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 => "author_qoc_per_author")) %>
</p>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
<% html_title(l(:label_repository), l(:label_statistics)) -%>

View File

@ -59,14 +59,6 @@
<div class="cl"></div>
</li>
<li ><span class="tit_fb ">测试结果:</span>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
</tbody>
</table>
<div class="cl"></div>
</li>
<% if @is_teacher%>
<!-- 编程作业老师才可以评分 -->
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">

View File

@ -55,21 +55,23 @@
<% end%>
<% if @is_teacher%>
<div class="fr">
<% if @homework.student_works.empty?%>
<%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %>
<% else%>
<%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json),
remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %>
<% unless @homework.homework_type == 2%>
<% if @homework.student_works.empty?%>
<%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %>
<% else%>
<%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json),
remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %>
<% end%>
<div class="info_ni_download" style="<%= @homework.homework_type == 1 ? '' : 'margin-left: 130px;'%>">
使用
<span class="c_red">winzip</span>
工具进行解压可能会导致
<span class="c_red">下载文件乱码</span>
,建议您使用
<span class="c_red">winrar</span>
工具进行解压
</div>
<% end%>
<div class="info_ni_download" style="<%= @homework.homework_type == 1 ? '' : 'margin-left: 130px;'%>">
使用
<span class="c_red">winzip</span>
工具进行解压可能会导致
<span class="c_red">下载文件乱码</span>
,建议您使用
<span class="c_red">winrar</span>
工具进行解压
</div>
<%= link_to("匿评", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%>
<%= link_to("缺评", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%>
<%= link_to l(:label_list), student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'down_btn fr'%>
@ -137,6 +139,14 @@
<% if @homework.homework_type == 2 && @homework.homework_detail_programing%>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
输入
</td>
<td class="td_tit">
输出
</td>
</tr>
<% @homework.homework_tests.each do |test|%>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
@ -149,8 +159,20 @@
<% end%>
</tbody>
</table>
<div class="cl"></div>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 开发语言:</span>
<div class="fl">
<% if @homework.homework_detail_programing.language.to_i == 1%>
C
<% elsif @homework.homework_detail_programing.language.to_i == 2%>
C++
<% end%>
</div>
</div>
<div class="cl"></div>
<% end%>
<div class="cl"></div>
<div class="mt5">
<% unless @homework.attachments.empty?%>

View File

@ -1,6 +1,6 @@
<div class="courses_list line" id="fans_item_<%=item.id%>">
<div class="courses_list_pic fl">
<a href="javascirpt:void();">
<a href="<%= user_path(item) %>">
<%= image_tag(url_to_avatar(item), :style=>"width:64px;height:64px;",:alt=>"头像") %>
</a>
</div>

View File

@ -45,10 +45,10 @@
<% if @organization.nil? %>
<% unless @first_page.nil? %>
<!-- 改为国际化后无法通过后台配置
<%= @first_page.description.html_safe %>
<%#= @first_page.description.html_safe %>
-->
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie_project)%></span>,&nbsp;
<span class="font_welcome_tdescription"><span class="font_welcome_tdescription"><%= l(:label_welcome_trustie_project_description)%></span></span>
<!--<span class="font_welcome_trustie"><%#= @first_page.title.html_safe %></span>,&nbsp;-->
<span class="font_welcome_tdescription"><span class="font_welcome_tdescription"><%= @first_page.description.html_safe %></span></span>
<% end %>
<% else %>
<span class="font_welcome_school" style="color: #E8770D">

View File

@ -350,7 +350,7 @@ zh:
label_input_email: 请输入邮箱地址
label_invite_trustie_user: "邀请Trustie注册用户"
label_invite_trustie_user_tips: "输入姓名、邮箱、昵称"
label_invite_trustie_user_tips: "支持姓名、邮箱、昵称搜索!"
label_user_role_null: 用户和角色不能留空!
label_invite_project: 邀请您加入项目
label_mail_invite_success: 您已成功加入项目!

View File

@ -715,6 +715,9 @@ zh:
label_commits_per_month: 每月提交次数
label_commits_per_author: 每用户提交次数
label_author_commits_per_month: 用户最近一月的提交次数
label_author_commits_six_month: 用户最近六个月的提交次数
label_author_commits_year: 最近一年的提交次数
label_view_diff: 查看差别
label_diff_inline: 直列
label_diff_side_by_side: 并排

View File

@ -454,13 +454,6 @@ ActiveRecord::Schema.define(:version => 20150722015428) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
create_table "discuss_demos", :force => true do |t|
t.string "title"
t.text "body"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "documents", :force => true do |t|
t.integer "project_id", :default => 0, :null => false
t.integer "category_id", :default => 0, :null => false
@ -861,6 +854,7 @@ ActiveRecord::Schema.define(:version => 20150722015428) do
t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false
t.integer "course_id"
t.datetime "updated_on"
end
add_index "news", ["author_id"], :name => "index_news_on_author_id"

View File

@ -5104,8 +5104,8 @@ KEditor.prototype = {
}
}
});
statusbar.removeClass('statusbar').addClass('ke-statusbar')
.append('<span class="ke-inline-block ke-statusbar-center-icon"></span>');
//statusbar.removeClass('statusbar').addClass('ke-statusbar')
// .append('<span class="ke-inline-block ke-statusbar-center-icon"></span>');
if (self._fullscreenResizeHandler) {
K(window).unbind('resize', self._fullscreenResizeHandler);
self._fullscreenResizeHandler = null;

View File

@ -113,7 +113,7 @@ a:hover.c_lgrey{ color:#3ca5c6;}
/* 20150506上传头像*/
.uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;}
.showpicBox{width:133px; height:250px; background:#f2f2f5; float:left; margin-left:20px; text-align:center; padding-top:15px; color:#666;}
.mr2{ margin-right:2px;}
.mr15{ margin-right:15px;}
.uppic_btn{border:none; width:150px; background:none; margin-bottom:5px; color:#666; margin-top:105px;}
/* 新建作品*/
.mr8{ margin-right:8px;}