Merge branch 'szzh' into develop

This commit is contained in:
sw 2014-12-18 16:03:09 +08:00
commit 00af0d9eaa
33 changed files with 449 additions and 319 deletions

View File

@ -318,7 +318,6 @@ class CoursesController < ApplicationController
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@role = params[:role]
@course_groups = @course.course_groups if @course.course_groups
@course_group_id = params[:@course_group_id] unless params[:@course_group_id].nil?
@show_serch = params[:role] == '2'
case params[:role]
when '1'
@ -340,6 +339,15 @@ class CoursesController < ApplicationController
render_403
end
end
# 显示每个学生的作业评分详情
def show_member_score
@member_score = Member.find(params[:member_id]) if params[:member_id]
respond_to do |format|
format.html {render :layout => 'course_base'}
format.js
end
end
#判断指定用户是否为课程教师
@ -840,4 +848,6 @@ class CoursesController < ApplicationController
render_404
end
end
end

View File

@ -348,7 +348,7 @@ class HomeworkAttachController < ApplicationController
else
end
else
render_403 :message => :notice_not_authorized
render_403
end
end

View File

@ -48,7 +48,7 @@ class SoftapplicationsController < ApplicationController
def show
@softapplication = Softapplication.find(params[:id])
@project = @softapplication.project
#@project = @softapplication.project
# 打分统计
stars_reates = @softapplication.
rates(:quality)

View File

@ -166,11 +166,27 @@ module CoursesHelper
def searchStudent project
#searchPeopleByRoles(project, StudentRoles)
members = []
project.members.each do |m|
members << m if m && m.user && m.user.allowed_to?(:as_student,project)
if m && m.user && m.user.allowed_to?(:as_student,project)
members << m
end
end
members
end
def search_student_and_score project
#searchPeopleByRoles(project, StudentRoles)
members = []
scores = []
project.members.each do |m|
if m && m.user && m.user.allowed_to?(:as_student,project)
members << m
end
end
members
end
def searchStudent_by_name project, name
#searchPeopleByRoles(project, StudentRoles)
members = []
@ -392,7 +408,13 @@ module CoursesHelper
return teacher_score_for_homework homework
end
end
def score_for_homework_new homework
if teacher_score_for_homework(homework) != 0
return teacher_score_for_homework homework
else
return student_score_for_homework homework
end
end
#获取作业的互评得分
def student_score_for_homework homework
#member = searchTeacherAndAssistant(homework.bid.courses.first).first#searchPeopleByRoles(homework.bid.courses.first,TeacherRoles).first

View File

@ -36,7 +36,7 @@ class Course < ActiveRecord::Base
acts_as_attachable :view_permission => :view_course_files,
:delete_permission => :manage_files
validates_presence_of :password, :term,:name,:description
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_length_of :description, :maximum => 10000

View File

@ -114,9 +114,50 @@ class Member < ActiveRecord::Base
member
end
# 查找每个学生每个作业的评分
def student_homework_score
teachers = find_course_teachers(self.course)
score_count = 0
homework_scores = HomeworkAttach.find_by_sql("SELECT homework_attaches.bid_id as bid_id, bids.name as name,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach'
AND rateable_id = homework_attaches.id AND rater_id IN (#{teachers}) ) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach'
AND rateable_id = homework_attaches.id AND rater_id NOT IN (#{teachers})) AS s_score
FROM homework_attaches, bids where homework_attaches.user_id = #{self.user_id}
and homework_attaches.bid_id IN (SELECT bid_id FROM homework_for_courses where course_id = #{self.course_id}
and homework_attaches.bid_id = bids.id)")
homework_scores.each do |homework|
if !homework.t_score.nil? && homework.t_score != 0
score = homework.t_score
else
if !homework.s_score.nil?
score= homework.s_score
else
score = 0
end
end
score_count = score_count + score
end
[homework_scores, format("%0.2f", score_count)]
end
protected
def validate_role
errors.add_on_empty :role if member_roles.empty? && roles.empty?
end
#获取课程的老师列表
def find_course_teachers course
searchTeacherAndAssistant(course).map{|teacher| teacher.user_id}.join(",")
end
def searchTeacherAndAssistant project
#searchPeopleByRoles(project, TeacherRoles)
members = []
project.members.each do |m|
members << m if m && m.user && m.user.allowed_to?(:as_teacher,project)
end
members
end
end

View File

@ -50,7 +50,7 @@
<h2>开启匿评功能</h2>
<p>
开启匿评后学生将不能对作业进行
<span class="c_blue">提交、修改、删除</span>
<span class="c_blue">修改、删除</span>
等操作,目前有
<span class="c_pink"><%= totle_size%>个</span>
学生,共提交了

View File

@ -124,14 +124,6 @@
</strong>)
<% end %>
</span>
<span class="font_lighter">
<%= l(:label_students_responses) %>
(
<strong>
<%= bid.commit.nil? ? 0 : bid.commit %>
</strong>
)
</span>
</td>
</tr>
<tr>

View File

@ -1,10 +1,7 @@
<script type="text/javascript">
function submitCoursesBoard()
{
if(regexSubject()&&regexContent())
{
$("#message-form").submit();
}
if(regexSubject()&&regexContent()){$("#message-form").submit();}
}
</script>
<div id="add-message" class="add_frame" style="display:none;">

View File

@ -1,5 +1,5 @@
<div class="top-content">
<%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %>
<%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get, :id => 'contests_serch') do %>
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf" rowspan="2">
@ -20,19 +20,41 @@
</td>
<td rowspan="2" >
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<script type="text/javascript">
function regexName()
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#contest_name_span").text("<%= l(:label_search_conditions_not_null) %>");
$("#contest_name_span").css('color','#ff0000');
$("#contest_name_span").focus();
return false;
}
else
{
$("#contest_name_span").text("");
return true;
}
}
function submitSerch()
{
if(regexName()){$("#contests_serch").submit();}
}
</script>
<%= text_field_tag 'name', params[:name], :size => 30, :onblur => 'regexName();' %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10">
<%= l(:label_search)%>
</a>
<br />
<span id="contest_name_span"></span>
</div>
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<a>
<%= link_to request.host()+"/contests", contests_path %>
<!-- end longjun -->
</a>
</td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_contest_innovate) %></a>
@ -43,14 +65,14 @@
<% end %>
</div>
<% if @contests.size > 0%>
<%= sort_contest(@s_state)%>
<%#= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div>
<% elsif @is_search%>
<%= render :partial => "layouts/no_content"%>
<% else %>
<%= sort_contest(@s_state)%>
<%#= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div>

View File

@ -20,7 +20,7 @@
%>
<% end %>
<% if @canShowCode %>
<a href="javascript:void(0)" class="f_l" onclick="$('#add_tag_<%= group.id %>').slideToggle();"><img src="/images/pic_edit.png" width="14" height="15" alt="编辑班级" /></a>
<a href="javascript:void(0)" class="f_l" onclick="document.getElementById('group_name<%= group.id %>').value='';$('#add_tag_<%= group.id %>').slideToggle();"><img src="/images/pic_edit.png" width="14" height="15" alt="编辑班级" /></a>
<% end %>
</li>
<li>
@ -36,7 +36,7 @@
<% end %>
<% if @canShowCode %>
<li style="margin-left:15px;">
<a href="javascript:void(0)" class="st_add f_l" onclick="$('#add_tag04').slideToggle();">+添加分班</a>
<a href="javascript:void(0)" class="st_add f_l" onclick="document.getElementById('group_name').value='';$('#add_tag04').slideToggle();">+添加分班</a>
</li>
<li>
<span id="add_tag04" style="display:none; vertical-align: middle;" class="ml10 f_l">
@ -44,7 +44,7 @@
<%= text_field_tag "group_name", params[:group_name], size: "20", class: "isTxt w90 f_l", style: "padding: 0px", maxlength: "100" %>
<%= submit_tag '', class: "submit f_l",:onclick => "validate_add_group()", style: "width: 43px;height: 21px;background: url(/images/btn.png) no-repeat 0 0;" %>
<%= link_to_function '', "$('#add_tag04').slideToggle();", class: "submit_2", style: "width: 43px"%>
<%= link_to_function '', "document.getElementById('group_name').value='';$('#add_tag04').slideToggle();", class: "submit_2", style: "width: 43px"%>
<% end %>
</span>

View File

@ -1,4 +1,4 @@
<div style="margin-left: 15px">
<div style="margin-left: 15px" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
<% if !@canShowCode %>
<%= join_in_course_group(@course.course_groups,@group, User.current) %>
@ -26,31 +26,66 @@
<% if @result_count %>
<p style="font-size: 18px;"><%= l(:label_search_member_count) %><%= @result_count %><%= l(:label_member_people) %></p>
<% end %>
<% members.each do |member| %>
<div class="well">
<div class="cl"></div>
<div class="st_box">
<ul class="st_box_top">
<% if @subPage_title == l(:label_student_list) %>
<li class="ml358"><a href="#" >作业积分</a><a href="#" class="st_down"></a></li>
<li class="ml50"><a href="#" >加入时间</a></li>
<% else %>
<li class="ml50" style="margin-left: 470px"><a href="#" >加入时间</a></li>
<% end %>
</ul>
<% members.each do |member| %>
<div class="cl"></div><!--st_box_top end-->
<div class="st_boxlist">
<% next if member.new_record? %>
<% unless member.created_on.nil? %>
<%= content_tag "p", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<% end %>
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :class => 'avatar')) %>
<a href="#" class="st_img" style="float:left;"> <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %></a>
<ul style="margin-left: 15px">
<% if @canShowCode %>
<%= content_tag "div", link_to(member.user.show_name, user_path(member.user)), :class => "nomargin avatar_name" %>
<li>
<%= l(:label_bidding_user_studentname) %> :
<%= link_to member.user.show_name, user_path(member.user) %>
</li> </br>
<%#= content_tag "li", "#{l(:label_bidding_user_studentname)}#{' : '}"link_to(member.user.show_name, user_path(member.user)) %>
<% else %>
<%= content_tag "div", link_to(member.user.name, user_path(member.user)), :class => "nomargin avatar_name" %>
<%= content_tag "li", link_to(member.user.name, user_path(member.user)) %>
<% end %>
<!--teacher's code disapeared moified by huang-->
<% if @canShowCode %>
<%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %>
<% if @canShowCode %>
<li>
<%= l(:label_bidding_user_studentcode) %> :
<%= link_to member.user.user_extensions.student_id, user_path(member.user) %>
</li>
<%#= content_tag "li", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :style=> "color:#1c9ec7;" %>
<% end %>
<div class ="clear avatar_name"> &nbsp;
<p>
</p>
</div>
</ul>
<% if @subPage_title == l(:label_student_list) %>
<%= link_to member.student_homework_score[1].to_s, {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => 'ml258 c_red', :style => "color:red;" %>
<% unless member.created_on.nil? %>
<%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey" %>
<% end %>
<% else %>
<% unless member.created_on.nil? %>
<%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey", :style=>"margin-left:195px" %>
<% end %>
<% end %>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div>
<% end; reset_cycle %>
</div>
<div class="pagination"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %></div>
<% else %>
<p class="nodata">

View File

@ -0,0 +1,58 @@
<style>
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; text-align:center; }
a:hover{ text-decoration:underline;}
/**** 常用***/
.f_l{ float:left;}
.f_r{ float:right;}
.b_lblue{ background:#64bdd9;}
.b_dblue{ background:#55a1b9; cursor:pointer;}
.f_b{ font-weight: bold;}
.c_blue{ color:#64bdd9;}
.c_grey{ color:#999999;}
.c_grey02{ color:#666666;}
.f_14{ font-size:14px;}
.c_dblue{ color:#3e6d8e;}
.w90{width:90px;}
.ml10{margin-left:10px;}
.ml5{margin-left:5px;}
.b_grey{ background:#a3a3a3;}
.c_blue02{ color:#15bcce; font-weight: bold;}
.w280{ display:block; width:280px;float:left;}
.w70{ display:block;width:70px; text-align:center; float:left;}
.c_red{ color:#e50000;}
.c_blue03{ color:#0d90c4;}
/***弹框***/
#popbox_tscore{width:480px;position:absolute;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(images/close.png) no-repeat;cursor:pointer;}
.tscore_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
.tscore_box{ width:350px; margin:15px auto;}
.tscore_box li{ height:25px;}
</style>
<div class="tscore_con">
<h2><%= @member_score.user.name %> 历次作业积分</h2>
<ul class="tscore_box">
<li ><span class="c_blue02 w280">作业名称</span><span class="c_blue02 w70">得分</span></li>
<% @member_score.student_homework_score[0].each do |homework_score| %>
<% if !homework_score.t_score.nil? && homework_score.t_score != 0 %>
<% score = homework_score.t_score %>
<% else %>
<% if !homework_score.s_score.nil? %>
<% score = homework_score.s_score %>
<% else %>
<% score = 0 %>
<% end %>
<% end %>
<li><span class="c_grey02 w280"><%= homework_score.name %></span><span class="c_red w70"><%= format("%0.2f",score) %></span></li>
<% end %>
<li><span class="c_blue03 w280">作业积分(总得分)</span><span class="c_red w70"><%= @member_score.student_homework_score[1] %></span></li>
</ul>
</div>

View File

@ -0,0 +1,3 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'courses/show_member_score', :locals => {:member => @member_score}) %>');
showModal('ajax-modal', '400px');
$('#ajax-modal').addClass('new-watcher');

View File

@ -2,22 +2,21 @@
<% attachmenttypes = @project.attachmenttypes %>
<% sufixtypes = @project.contenttypes %>
<span class="borad-title"><%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区</span>
<span class="borad-title">
<%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>
资源共享区
</span>
<div class="content-title-top">
<%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
<div class="clearfix"></div>
<div id="file_buttons" class="nhidden">
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %>
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
<p></p>
<div id="upload_file_div" class="relation_file_div hidden">
<%= render :partial => 'new', locals: {project: @project} %>
</div>
<div id="relation_file_div" class="relation_file_div hidden">
<fieldset>
<legend>搜索</legend>
@ -48,16 +47,23 @@
</div>
<div class="box" id="files-box">
<label for="files-box" style="font-weight:bold;">&nbsp;&nbsp;<%= l(:label_files_filter) %></label>
<label for="files-box" style="font-weight:bold;">
&nbsp;&nbsp;
<%= l(:label_files_filter) %>
</label>
<% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]),
<label for="attachment_browse_label">
<%= l(:attachment_browse) %>
</label>
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]),
:onchange => "attachmenttypes_searchex(this.value)" %>
<% end %>
<% if sufixtypes.any? %>
&nbsp;
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label>
<label for="attach_sufix_browse_label">
<%= l(:attachment_sufix_browse) %>
</label>
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
:onchange => "attachment_contenttypes_searchex(this.value)" %>
<% end %>
@ -65,20 +71,14 @@
</div>
<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<div id="all_browse_div" class="all_browse_div">
<%#= render :partial => 'show_all_attachment' %>
<% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %>
<%= render partial: "show_all_attachment"%>
<%= render partial: "show_all_attachment"%>
<%else%>
<%= render partial: "sort_by_attachtypel"%>
<%= render partial: "sort_by_attachtypel"%>
<%end%>
</div>

View File

@ -1,67 +1,69 @@
<div class="autoscroll">
<ul>
<% issue_list(issues) do |issue, level| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<ul>
<% issue_list(issues) do |issue, level| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<% reset_cycle %>
<% previous_group = group %>
<% end %>
<div style="">
<li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
<% end %>
<div style="">
<li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
<% if issue.tracker_id == 1 %>
<%= image_tag("/images/task.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 2 %>
<%= image_tag("/images/feature.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 3 %>
<%= image_tag("/images/support.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 4 %>
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %>
<% end %>
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals =>
{:obj => issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%>
</span>
<ul class="issue_list">
<% unless issue.author.nil? || issue.author.name == "Anonymous" %>
<ul class="list-group-item-meta" style="word-break: break-all;word-wrap: break-word;width: 100%;">
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals =>
{:obj => issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%>
</span>
<span>
<%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %>
</span>
<%= l(:label_post_on)%>
<% a = [] %>
<% a << column_content[1] %>
<%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue.id), :class => "issue-link" , :target =>"_blank"%>
<% if issue.tracker_id == 1 %>
<%= image_tag("/images/task.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 2 %>
<%= image_tag("/images/feature.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 3 %>
<%= image_tag("/images/support.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 4 %>
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %>
<% end %>
<ul class="issue_list">
<% unless issue.author.nil? || issue.author.name == "Anonymous" %>
<ul class="list-group-item-meta" style="word-break: break-all;word-wrap: break-word;">
<span> <%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %></span>
<%= l(:label_post_on)%> <% a = [] %>
<% a << column_content[1] %>
<%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue.id), :class => "issue-link" , :target =>"_blank"%>
</ul>
<% end -%>
<ul class="list-group-item-meta">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable issue, :description %>
</div>
</ul>
<ul class="list-group-item-meta">
<% unless issue.assigned_to_id.nil? %>
<span>
<%= l(:field_assigned_to)%>&nbsp;
</span>
<ul class="list-group-item-meta">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable issue, :description %>
</div>
</ul>
</ul>
<ul class="list-group-item-meta" style="margin-top: -15px;">
<% unless issue.assigned_to_id.nil? %>
<span>
<%= l(:field_assigned_to)%>&nbsp;
</span>
<%= raw column_content[5] %>&nbsp;
<% end %>
<%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %>
<div class="find-comment-class">
<% end %>
<%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %>
<div class="find-comment-class">
<span>
<%= link_to l(:label_find_all_comments), issue_path(issue.id) %>
</span>
<%= l(:label_comments_count, :count => issue.journals.all.count) %>
</div>
</ul>
</ul>
</li>
</div>
<% end -%>
</ul>
<%= l(:label_comments_count, :count => issue.journals.all.count) %>
</div>
</ul>
<% end -%>
</ul>
</li>
</div>
<% end -%>
</ul>
</div>

View File

@ -17,7 +17,8 @@
<%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_contest_innovate) %></a>
<span>
<% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%>
<% contest = @softapplication.contests.first %>
<%= contest ? link_to(">" + contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%>
</span>
</td>

View File

@ -30,7 +30,7 @@
<div id="content_">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<%= call_hook :view_layouts_base_course %>
<div style="clear:both;"></div>
<%=render :partial => 'layouts/base_footer'%>
</div>

View File

@ -1,7 +1,5 @@
<% @nav_dispaly_course_all_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_course_label = nil
@nav_dispaly_store_all_label = 1 %>
<% @nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1 %>
<!DOCTYPE html>
<html lang="<%= current_language %>">
<head>

View File

@ -15,7 +15,7 @@
} do |f| %>
<%= render :partial => 'form',
:locals => {:f => f, :replying => !@message.parent.nil?} %>
<a href="#" onclick="$('#message-form').submit();" class="ButtonColor m3p10">
<a href="#" onclick="if(regexSubject()&&regexContent()){$('#message-form').submit();}" class="ButtonColor m3p10">
<%= l(:button_save) %>
</a>
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %>

View File

@ -1,7 +1,15 @@
<% if @project %>
<h3><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h3>
<h3>
<%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %>
&#187;
<%= l(:label_message_new) %>
</h3>
<% elsif @course %>
<h3><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :course_id => @course, :id => @board %> &#187; <%= l(:label_message_new) %></h3>
<h3>
<%= link_to h(@board.name), :controller => 'boards', :action => 'show', :course_id => @course, :id => @board %>
&#187;
<%= l(:label_message_new) %>
</h3>
<% end %>
<%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>

View File

@ -1,71 +0,0 @@
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= hubspot_head %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<% if @project %>
<h3 class="title"><%= l(:label_projects_score) %></h3>
<div class="inf_user_image">
<table style="border-bottom: solid 1px #80a6d2;" width="100%">
<tr>
<td align="left" valign="middle" ><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<td>
<table>
<tr class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><td><%= @project.name %></td>
</tr>
</table>
</td>
<td width="35%">
<table>
<tr class="info_font"><td><%= l(:label_projects_score) %></td></tr>
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , project_scores(@project) ).to_i %></span></td></tr>
</table>
</td>
</tr>
</table>
</div>
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> :
<%= format("%.2f" , project_scores(@project) ).to_i %>
</li>
<li>
<%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> :
<%= format("%.2f" , issue_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> :
<%= format("%.2f" , news_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> :
<%= format("%.2f" , documents_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> :
<%= format("%.2f" , changesets_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> :
<%= format("%.2f" , board_message_score(@project)).to_i %>
</li>
</ul>
</div>
<div id="show_score_detail">
<%= render :partial => 'projects/project_score_index', :locals => {:index => 0,:project => @project } %>
</div>
<% end %>

View File

@ -1,4 +1,5 @@
<%= render :partial => 'layouts/base_softapplication_top_content' %>
<% html_title(@softapplication.name) -%>
<div style="height: auto; padding-bottom: 10px" class="softapplications-div">
<tr>
<td colspan="2" valign="top" width="320">
@ -47,8 +48,9 @@
</tr>
<tr>
<td style="padding-left: 40px">
<% if @project %>
<%=l(:label_attendingcontestwork_deposit_project)%><%= link_to "#@project", project_path(@project) %>
<% if @softapplication.project %>
<%=l(:label_attendingcontestwork_deposit_project)%>
<%= link_to "#{@softapplication.project}", project_path(@softapplication.project) %>
<% end %>
</td>
</tr>

View File

@ -44,14 +44,14 @@
<span>
<%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);',
:class => "tags_icona",
:onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').slideToggle(); readmore(this);" if User.current.logged? %>
:onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %>
<%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %>
</span>
&nbsp;&nbsp;
<div id="tags_show-<%=obj.class%>-<%=obj.id%>" style="display:inline; ">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
<div id="put-tag-form-<%=obj.class%>-<%=obj.id%>" style="display: none;height: 100px;">
<div id="put-tag-form-<%=obj.class%>-<%=obj.id%>" style="display: none;">
<%= render :partial => "courses/course_resources_html", :locals => {:obj => obj ,:object_flag => object_flag } %>
</div>
<% else %>

View File

@ -9,108 +9,103 @@
</script>
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求 7代表竞赛 9代表课程-->
<% @tags = obj.reload.tag_list %>
<% if non_list_all and (@tags.size > 0) %>
<!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 -->
<% if @tags.size > Setting.show_tags_length.to_i then %>
<% i = 0 %>
<% until i>Setting.show_tags_length.to_i do %>
<div id="tag">
<%= link_to @tags[i], :controller => "tags", :action => "index", :q => @tags[i], :object_flag => object_flag, :obj_id => obj.id %>
</div>
<% i += 1 %>
<% end %>
<%= more_tags(obj.id,object_flag)%>
<% else %>
<% @tags.each do |tag| %>
<div id="tag">
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
</div>
<% end %>
<% end %>
<% else %>
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<div id="tag">
<span class="tag_show"> <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
<% case object_flag %>
<% when '1' %>
<% if User.current.eql?(obj) %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% when '2' %>
<% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% when '3' %>
<% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_id) == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% when '4' %>
<% if obj.author_id == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% when '5' %>
<% test = Forum.find(obj.id) %>
<% if test && test.creator_id == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% when '6' %>
<%# if (User.current.logged? &&
User.current.admin?
# && (@project && User.current.member_of?(@project))
)
%>
<% if obj.author_id == User.current.id || User.current.admin?%>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% when '7' %>
<% if obj.author_id == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% when '9' %>
<% if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% end %>
</span>
<span class="tag_show">
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
<% case object_flag %>
<% when '1' %>
<% if User.current.eql?(obj) %>
<span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% end %>
<% when '2' %>
<% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
<span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% end %>
<% when '3' %>
<% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_id) == User.current.id %>
<span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% end %>
<% when '4' %>
<% if obj.author_id == User.current.id %>
<span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% end %>
<% when '5' %>
<% test = Forum.find(obj.id) %>
<% if test && test.creator_id == User.current.id %>
<span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% end %>
<% when '6' %>
<%# if (User.current.logged? &&
User.current.admin?
# && (@project && User.current.member_of?(@project))
)
%>
<% if obj.author_id == User.current.id || User.current.admin?%>
<span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% end %>
<% when '7' %>
<% if obj.author_id == User.current.id %>
<span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% end %>
<% when '9' %>
<% if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %>
<span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% end %>
<% end %>
</span>
</div>
<% end %>
<% else %>
<span style="color:#8c8a8a">
&nbsp;&nbsp;&nbsp;<%= l(:label_tags_no) %>
</span>
&nbsp;&nbsp;&nbsp;
<%= l(:label_tags_no) %>
</span>
<% end %>
<% end %>

View File

@ -4,31 +4,40 @@
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %></td>
<td colspan="2" valign="top" width="50">
<%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %>
</td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<span><%= link_to_course(membership.course) %></span>
<span>
<%= link_to_course(membership.course) %>
</span>
<span style="float: right">
<%= render :partial => 'courses/set_course_time', :locals => {:course => membership.course} %>
<% if User.current == @user %>
<% (membership.roles).each do |role| %>
<% unless (role == Role.find(9) || role == Role.find(3)) %>
<%= join_in_course(membership.course, User.current) %>
<% end %>
<% end %>
<% else %>
<% if (User.current == @user && (!@user.allowed_to?(:as_teacher,membership.course)))%>
<%= join_in_course(membership.course, User.current) %>
<% end %>
&nbsp;&nbsp;&nbsp;&nbsp;
<%= l(:label_x_base_courses_member, :count => membership.course.members.count) %>
(<%= "#{membership.course.members.count}" %>)&nbsp;&nbsp;
(<%= "#{membership.course.members.count}" %>)
&nbsp;&nbsp;
<%= l(:label_homework) %>
(<span class=""><%= link_to (membership.course.homeworks.count), {:controller => 'courses', :action => 'homework', :id => membership.course.id} %></span>)
(
<span class="">
<%= link_to (membership.course.homeworks.count), {:controller => 'courses', :action => 'homework', :id => membership.course.id} %>
</span>
)
&nbsp;&nbsp;
<%= l(:label_course_news) %>
(<span style="color: #ed8924"><%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %></span>)
</span></td>
(
<span style="color: #ed8924">
<%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %>
</span>)
</span>
</td>
</tr>
<tr>
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
@ -42,10 +51,14 @@
<% @course = Course.find_by_extra(membership.course.extra) %>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
<span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %>
: <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %></span>
<span style="float: right; padding-left: 8px"><%= l(:label_course_term) %>
: <%= @course.time %><%= @course.term %></span>
<span class="font-lighter" style="float: left">
<%= l(:label_main_teacher) %>
: <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %>
</span>
<span style="float: right; padding-left: 8px">
<%= l(:label_course_term) %>
: <%= @course.time %><%= @course.term %>
</span>
<% end %>
</td>
</tr>

View File

@ -1,15 +1,15 @@
<div class="content-title-top">
<% if @memberships.empty? %>
<% if @user != User.current %>
<p class="font_description">
<%= l(:label_project_course_un) %>
</p>
<p class="font_description">
<%= l(:label_project_course_un) %>
</p>
<% else %>
<p class="font_description">
<%= l(:label_project_cousre_studentun) %><%= link_to"#{l(:label_course_join_student)}",{:controller=>'courses',:action=>'index'}, :class => 'icon icon-add' %>
<%= link_to "#{l(:label_course_new)}", {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
</p>
<p class="font_description">
<%= l(:label_project_cousre_studentun) %>
<%= link_to"#{l(:label_course_join_student)}",{:controller=>'courses',:action=>'index'}, :class => 'icon icon-add' %>
<%= link_to "#{l(:label_course_new)}", {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
</p>
<% end %>
<% else %>
<div class="user_course_list menu-div">

View File

@ -5,4 +5,4 @@
:action => 'show_new_score',
:remote => true,
:id => user.id
}, :style => 'color :#E8770D;',:id => 'user_score') %>
}, :style => 'color :#E8770D;',:id => 'user_score') %>

View File

@ -9,7 +9,6 @@
$("content-title-top p:first").find("a").attr("target", "_blank");
$("#content .content_frame [color=#666666]").find("a").removeAttr("target");
$('#content .content-title-top table[width=580] td:first span:eq(1)').find("a:first").removeAttr("target");
});
</script>

View File

@ -1572,6 +1572,7 @@ zh:
label_bidding_user: 应标人:
label_bidding_user_homework: 作业提交者
label_bidding_user_studentcode: 学号
label_bidding_user_studentname: 姓名
label_bidding_reason: 应标宣言:
label_bidding_reason_homewrok: 作业提交说明
label_username: 用户名:

View File

@ -641,6 +641,7 @@ RedmineApp::Application.routes.draw do
get 'file', :action => 'file', :as => 'file'
get 'feedback', :action => 'feedback', :as => 'course_feedback'
get 'member', :controller => 'courses', :action => 'member', :as => 'member'
get 'member_score', :to => 'courses#member_score'
post 'finishcourse'
post 'restartcourse'
match "searchmembers", :controller => 'courses', :action => 'searchmembers', :via => [:post,:get]
@ -648,6 +649,7 @@ RedmineApp::Application.routes.draw do
match "updategroupname", :via => [:post, :get]
match "addgroups", :via => [:post, :get]
match 'deletegroup', :via => [:delete]
match 'show_member_score', :via => [:get]
post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group'
delete 'join_in/join_group', :to => 'courses#unjoin_group'
end

View File

@ -60,15 +60,15 @@ input.f_2 {
.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
a.st_img { display:block;width:40px; height:40px; border:1px solid #CCC; padding:1px;}
a:hover.st_img { border:1px solid #1c9ec7; }
.st_boxlist{ border-bottom:1px dashed #CCC; height:53px; padding-top:10px; }
.st_boxlist a{ float:left;}
.st_boxlist{ border-bottom:1px dashed #CCC; height:53px; padding-top:10px;padding-bottom: 10px; }
.st_boxlist a{ }
.st_boxlist ul{ float:left; width:200px; margin-left:10px;}
.st_boxlist ul li a{ color:#5d5d5d;}
.st_boxlist ul li a span{ color:#1c9ec7;}
.st_boxlist ul li a:hover span{ color:#ff8e15;}
.st_boxlist ul li a { color:#1c9ec7;}
.st_boxlist ul li a:hover{ color:#ff8e15;}
.ml50{ margin-left:50px;}
.ml358{ margin-left:358px;}
.ml258{ margin-left:254px;}
.ml358{ margin-left:360px;}
.ml258{ margin-left:110px;}
.ml65{ margin-left:65px;}
a:hover.st_add{ color:#ff8e15;}