Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: db/schema.rbguange_homework
commit
521b2cd8de
@ -0,0 +1,5 @@
|
||||
class Dts < ActiveRecord::Base
|
||||
attr_accessible :Category, :Defect, :Description, :File, :IPLine, :IPLineCode, :Method, :Num, :PreConditions, :Review, :StartLine, :TraceInfo, :Variable, :project_id
|
||||
|
||||
belongs_to :project
|
||||
end
|
@ -0,0 +1,42 @@
|
||||
# encoding: utf-8
|
||||
class StudentWorkTest < ActiveRecord::Base
|
||||
attr_accessible :student_work_id, :homework_test_id
|
||||
|
||||
belongs_to :homework_test
|
||||
belongs_to :student_work
|
||||
|
||||
def status_to_s
|
||||
case self.result
|
||||
when -1
|
||||
'编译出错'
|
||||
when -2
|
||||
'答题错误'
|
||||
when -3
|
||||
'答案错误'
|
||||
when 1
|
||||
'运行出错'
|
||||
when 2
|
||||
'超时'
|
||||
when 3
|
||||
'内存超出'
|
||||
when 4
|
||||
'输出超出'
|
||||
when 5
|
||||
'禁用函数'
|
||||
when 6
|
||||
'其他错误'
|
||||
when 0
|
||||
'成功'
|
||||
else
|
||||
'未知错误'
|
||||
end
|
||||
end
|
||||
|
||||
def test_score
|
||||
if self.result == 0
|
||||
format("%.1f",100.0 / self.student_work.homework_common.homework_tests.count)
|
||||
else
|
||||
0
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,3 @@
|
||||
class Visitor < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
end
|
@ -1,4 +1,8 @@
|
||||
<% if @source_type=='User' %>
|
||||
var imgSpan = $("img[nhname='avatar_image']");
|
||||
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
|
||||
<% else %>
|
||||
var imgSpan = jQuery('#avatar_image');
|
||||
|
||||
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
|
||||
|
||||
<% end %>
|
@ -1,10 +1,10 @@
|
||||
<!-- huang -->
|
||||
<h3><%=l(:label_newtype_contest)%></h3>
|
||||
<!--<!– huang –>-->
|
||||
<!--<h3><%=l(:label_newtype_contest)%></h3>-->
|
||||
|
||||
<%= labelled_form_for @bid, :url => {:controller => 'bids', :action => 'create_contest'} do |f| %>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'form_contest', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= javascript_tag "$('#bid_name').focus();" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--<%= labelled_form_for @bid, :url => {:controller => 'bids', :action => 'create_contest'} do |f| %>-->
|
||||
<!--<div class="box tabular">-->
|
||||
<!--<%= render :partial => 'form_contest', :locals => { :f => f } %>-->
|
||||
<!--<%= submit_tag l(:button_create) %>-->
|
||||
<!--<%= javascript_tag "$('#bid_name').focus();" %>-->
|
||||
<!--<% end %>-->
|
||||
<!--</div>-->
|
@ -1,8 +1,8 @@
|
||||
<% if @save_flag %>
|
||||
$('#finish_course_<%=@course.id%>').replaceWith("<%= escape_javascript(set_course_time(@course_prefs))%>");
|
||||
$('#finish_course_<%=@course.id%>').replaceWith("<%= escape_javascript(set_course_time(@course_prefs))%>");
|
||||
var html = "<%= escape_javascript( render( :partial => 'users/course_form', :locals => {:item => @course_prefs} ) )%>";
|
||||
$('#nh_course_<%=@course.id%>').replaceWith(html);
|
||||
// alert("关闭成功");
|
||||
<% else %>
|
||||
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
|
||||
<% end %>
|
||||
|
||||
|
||||
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
|
||||
<% end %>
|
@ -0,0 +1,30 @@
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= error_messages_for 'homework_common' %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2">
|
||||
<%= l(:label_course_homework_new)%>
|
||||
</h2>
|
||||
</div>
|
||||
<% if @homework_type == "1"%>
|
||||
<div class="hwork_new">
|
||||
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
|
||||
<%= hidden_field_tag "course",@course.id%>
|
||||
<%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
|
||||
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
|
||||
<%= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
|
||||
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
|
||||
<% end%>
|
||||
</div><!--hwork_new end-->
|
||||
<% elsif @homework_type == "2"%>
|
||||
<div class="hwork_new">
|
||||
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
|
||||
<%= hidden_field_tag "course",@course.id%>
|
||||
<%= hidden_field_tag "homework_common[homework_type]","2"%>
|
||||
<%= render :partial => 'homework_common/homework_detail_programing_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
|
||||
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
|
||||
<%= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
|
||||
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
|
||||
<% end%>
|
||||
</div><!--hwork_new end-->
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
@ -0,0 +1,13 @@
|
||||
<div id="Footer">
|
||||
<ul class="copyright" style="text-align:center;">
|
||||
<li><%= @organizer.description.html_safe %></li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<ul class="footlogo">
|
||||
<% @companies && @companies.each do |company| %>
|
||||
<li class="fl" style="margin:0 8px;">
|
||||
<a href="<%= company.url %>" target="_blank" title="<%=company.name%>"><img src="<%= url_to_avatar(company) %>" width="100" height="30" alt="<%=company.name%>" /></a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
@ -0,0 +1,77 @@
|
||||
<div id="Header" >
|
||||
<div class="logo fl" >
|
||||
<%=link_to image_tag("/images/logo.png",weight:"35px", height: "30px")%>
|
||||
</div>
|
||||
<div id="TopNav" class="fl">
|
||||
<%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
|
||||
</div>
|
||||
<div id="TopUser" class="fr">
|
||||
<div id="menu">
|
||||
<ul class="menu">
|
||||
<% if User.current.logged? %>
|
||||
<li>
|
||||
<%=link_to_user(User.current)%><!--<a href="javascript:void(0);" class="parent">用户名称</a>-->
|
||||
<ul>
|
||||
<% 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) -%>
|
||||
<% hasCourse=false %>
|
||||
<% User.current.courses.each do |course| %>
|
||||
<% if !course_endTime_timeout?(course) %>
|
||||
<% hasCourse=true %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if hasCourse %>
|
||||
<li>
|
||||
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :id=>User.current.id, :host=>Setting.host_user) %>" class="parent">我的课程</a>
|
||||
<ul>
|
||||
<% User.current.courses.each do |course| %>
|
||||
<% if !course_endTime_timeout?(course) %>
|
||||
<li title="<%=course.name%>"><a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>course.id, :host=>Setting.host_course) %>"><%= course.name %></a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
<%# end -%>
|
||||
<% end %>
|
||||
|
||||
<% if User.current.projects.count>0 %>
|
||||
<li>
|
||||
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :id=>User.current.id, :host=>Setting.host_user) %>" class="parent">我的项目</a>
|
||||
<ul>
|
||||
<% User.current.projects.each do |project| %>
|
||||
<li title="<%=project.name%>"><a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>project.id, :host=>Setting.host_name) %>"><%=project.name%></a></li>
|
||||
<% end %>
|
||||
</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>-->
|
||||
<!--<li><a href="javascript:void(0);">我的课程0我的课程我的课程01我的课程011</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);">我的课程02</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);">我的课程02</a></li>-->
|
||||
<!--</ul><!–-level3 end-–>-->
|
||||
<!--</li><!–-level2 end-–>-->
|
||||
<!--<li><a href="javascript:void(0);" class="parent">我的项目</a>-->
|
||||
<!--<ul>-->
|
||||
<!--<li><a href="javascript:void(0);">新建项目</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);">我的项目01</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);">我的项目0</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);">我的项目02</a></li>-->
|
||||
<!--</ul><!–-level3 end-–>-->
|
||||
<!--</li><!–-level2 end-–>-->
|
||||
<!--<li><a href="javascript:void(0);">我的主页</a></li>-->
|
||||
</ul>
|
||||
</li><!---level1 end--->
|
||||
<!--<li ><a href="javascript:void(0);">退出</a></li>-->
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= render_menu :account_menu -%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
@ -0,0 +1,12 @@
|
||||
<% fans_count,fans_list = get_fans_users(user) %>
|
||||
<div id="fans_nav_list" class="leftbox mt10" style="display:<%= fans_count==0 ? 'none' : 'block' %>">
|
||||
<h4 class="fl">粉丝</h4><a href="<%=url_for(:controller => 'users', :action => 'user_fanslist', :id=>user.id)%>" data-count="<%= fans_count %>" style="display:<%= fans_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
|
||||
<div class="cl"></div>
|
||||
<div class="mt5">
|
||||
<% for fans in fans_list %>
|
||||
<%= link_to image_tag(url_to_avatar(fans), :style => "width:38px;height:38px;"), user_path(fans), :class => "pic_members", :title => "#{fans.name}" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div><!--leftbox end-->
|
||||
|
@ -0,0 +1,8 @@
|
||||
<% if(User.current.logged? && User.current!=target)%>
|
||||
<%if(target.watched_by?(User.current))%>
|
||||
<a id="user_watch_id" href="<%= watch_path(:object_type=>
|
||||
'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消</a>
|
||||
<% else %>
|
||||
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">关注</a>
|
||||
<% end %>
|
||||
<% end %>
|
@ -0,0 +1,11 @@
|
||||
<% watcher_count,watcher_list = get_watcher_users(user) %>
|
||||
<div id="watcher_nav_list" class="leftbox mt10" style="display:<%= watcher_count==0 ? 'none' : 'block' %>">
|
||||
<h4 class="fl">关注</h4><a href="<%=url_for(:controller => 'users', :action => 'user_watchlist', :id=>user.id)%>" data-count="<%= watcher_count %>" style="display:<%= watcher_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
|
||||
<div class="cl"></div>
|
||||
<div class="mt5">
|
||||
<% for watcher in watcher_list %>
|
||||
<%= link_to image_tag(url_to_avatar(watcher), :style => "width:38px;height:38px;"), user_path(watcher), :class => "pic_members", :title => "#{watcher.name}" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div><!--leftbox end-->
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
$("img[nhname='avatar_image']").attr('src',$("#nh_user_tx").attr('src'));
|
||||
$('#ajax-modal').html($("#nh_tx_dialog_html").html());
|
||||
showModal('ajax-modal','460px');
|
||||
$('#ajax-modal').siblings().hide();
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
//$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
@ -0,0 +1,2 @@
|
||||
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>');
|
||||
hideModal();
|
@ -0,0 +1,30 @@
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h22"><%= l(:label_project_dts_statics) %></h2>
|
||||
</div>
|
||||
<p class="fr f14 ">语言:<span style="color: red">Java</span> 总文件数:<span style="color: red">361</span> 代码行数:<span style="color: red">48662</span></p>
|
||||
|
||||
<!--<p class="box_h3" style="text-align:center; padding-top: 20px; ">具体测试结果</p>-->
|
||||
<!--<div style="font-size: 14px;">-->
|
||||
<!--<p class="">描叙:</p>-->
|
||||
<!--<p style="padding-left: 10px;color:#ACAEB1 "><%#= @dts.Description %></p>-->
|
||||
<!--</div>-->
|
||||
<% @dts.each do |dt| %>
|
||||
<table width="600" border="2" bordercolor="red" style="padding-top: 10px; padding-left: 30px;">
|
||||
<tr>
|
||||
<td align="center" bgcolor="#999999" style="width: 80px"><strong>错误变量</strong></td>
|
||||
<td style="width: 120px"><%= dt.Variable %></td>
|
||||
<td align="center" bgcolor="#999999" style="width: 80px"><strong>起始行</strong></td>
|
||||
<td style="width: 120px"><%= dt.StartLine %></td>
|
||||
<td align="center" bgcolor="#999999" style="width: 80px"><strong>IP行</strong></td>
|
||||
<td><%= dt.IPLine %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" bgcolor="#999999"><strong>缺陷代码</strong></td>
|
||||
<td colspan="5"><%= dt.IPLineCode %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" bgcolor="#999999"><strong>错误描述</strong></td>
|
||||
<td colspan="5"><%= dt.Description %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
@ -0,0 +1,76 @@
|
||||
<div class="show_hwork_arrow"></div>
|
||||
<div class="show_hwork">
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">
|
||||
上交时间:
|
||||
</span>
|
||||
<%=format_time @work.created_at %>
|
||||
</li>
|
||||
<% if @work.user != User.current%>
|
||||
<!-- 不是自己显示为点赞,编程作业不可编辑和删除 -->
|
||||
<li class="fr" id="student_work_praise_<%= @work.id%>">
|
||||
<%= render :partial => 'student_work_praise' %>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<li >
|
||||
<span class="tit_fb ">
|
||||
编程代码:
|
||||
</span>
|
||||
<div class="show_hwork_p break_word">
|
||||
<%= text_format @work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li ><span class="tit_fb ">测试结果:</span>
|
||||
<table class="border_ce" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<!--<%#@work.student_work_test.each do |test|%>-->
|
||||
<!--<tr class="<%#= cycle("", "b_grey") %>">-->
|
||||
<!--<td class="td_tit">-->
|
||||
<!--<%#= test.homework_test.input%>-->
|
||||
<!--</td>-->
|
||||
<!--<td class="td_tit">-->
|
||||
<!--<%#= test.homework_test.output%>-->
|
||||
<!--</td>-->
|
||||
<!--<td class="td_50 c_red"><%#= test.status_to_s%></td>-->
|
||||
<!--<td class="td_50 "><%#= test.test_score%></td>-->
|
||||
<!--</tr>-->
|
||||
<!--<%# end%>-->
|
||||
|
||||
<%@homework.homework_tests.each do |test|%>
|
||||
<tr class="<%= cycle("", "b_grey") %>">
|
||||
<td class="td_tit">
|
||||
<%= test.input%>
|
||||
</td>
|
||||
<td class="td_tit">
|
||||
<%= test.output%>
|
||||
</td>
|
||||
<td class="td_50 c_red"><%= test.student_work_test.nil? ? "正在编译" : test.student_work_test.status_to_s%></td>
|
||||
<td class="td_50 "><%= test.student_work_test.nil? ? "0" : test.student_work_test.test_score%></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% if @is_teacher%>
|
||||
<!-- 编程作业老师才可以评分 -->
|
||||
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</ul>
|
||||
|
||||
<div class="ping_box mt10" id="score_list_<%= @work.id%>" style="<%= @work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%@work.student_works_scores.order("updated_at desc").each do |score|%>
|
||||
<div id="work_score_<%= score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</div><!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="fr c_blue mt5 mb5" onclick="$('#about_hwork_<%= @work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div><!---show_hwork end--->
|
@ -0,0 +1 @@
|
||||
成功
|
@ -1,74 +1,46 @@
|
||||
<div class="content_frame">
|
||||
<ul class="user_course_sort">
|
||||
<% for membership in memberships %>
|
||||
<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>
|
||||
<table width="580" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top">
|
||||
<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 && (!@user.allowed_to?(:as_teacher,membership.course)))%>
|
||||
<%= join_in_course(membership.course, User.current) %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%= l(:label_x_base_courses_member, :count => membership.course.members.count) %>
|
||||
(<%= "#{membership.course.members.count}" %>)
|
||||
|
||||
<%= l(:label_homework) %>
|
||||
(
|
||||
<span class="">
|
||||
<%= link_to (membership.course.homework_commons.count), homework_common_index_path(:course => membership.course.id) %>
|
||||
</span>
|
||||
)
|
||||
|
||||
<%= 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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
|
||||
<p class="font_description">
|
||||
<%= textilizable membership.course.short_description %>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<% @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 %><%= get_course_term_locales @course %>
|
||||
</span>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
|
||||
<% can_edit_flag = User.current.allowed_to?(:as_teacher,item) || User.current.admin? %>
|
||||
<% course_end_flag = course_endTime_timeout?(item) %>
|
||||
<div class="courses_list line" id="nh_course_<%=item.id%>">
|
||||
<div class="courses_list_pic fl">
|
||||
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" title="<%= item.name %>">
|
||||
<%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %>
|
||||
</a>
|
||||
</div>
|
||||
<div class="courses_list_info fl ml10">
|
||||
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" title="<%= item.name %>" class="courses_list_title f14 fb <%=course_end_flag ? 'c_dark' : 'c_blue02'%> fl"><%= item.name %></a>
|
||||
<% if(can_edit_flag) %>
|
||||
<% if(course_end_flag) %>
|
||||
<a href="<%=restartcourse_course_path(item)%>" class="pic_eye_grey fl ml5" title="重开课程" data-confirm="确定要重开课程?" data-method="post" data-remote="true"></a>
|
||||
<% else %>
|
||||
<a href="<%=finishcourse_course_path(item, format: :js)%>" class="pic_eye_blue fl ml5" title="关闭课程" data-confirm="确定要关闭课程?" data-method="post" data-remote="true"></a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<%= call_hook :view_account_left_bottom, :user => @user %>
|
||||
<div class="cl"></div>
|
||||
<div class="courses_list_table">
|
||||
<table><tbody>
|
||||
<tr>
|
||||
<td class="td_w60 ">主讲老师:</td>
|
||||
<td class="td_w70 ">
|
||||
<a href="<%= user_path(item.teacher) %>" title="<%= item.teacher.show_name %>"><%= item.teacher.show_name %></a>
|
||||
</td>
|
||||
<td class="td_w60 ">课程作业:</td>
|
||||
<td class="td_w110 "><a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>"><%= item.homework_commons.count %></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>学生人数:</td>
|
||||
<td><a href="<%= url_for(:controller => 'courses', :action=>"member", :id=>item.id,:role=>2, :host=>Setting.host_course) %>"><%= studentCount(item) %></a></td>
|
||||
<td>开课学期:</td>
|
||||
<td><%= item.time %><%= get_course_term_locales item %></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</div>
|
||||
</div>
|
||||
<% 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)%>" 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)%>" target="_blank" class="blue_n_btn fr mt20">提交作品</a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
@ -0,0 +1,50 @@
|
||||
<div class="courses_list line" id="fans_item_<%=item.id%>">
|
||||
<div class="courses_list_pic fl">
|
||||
<a href="javascirpt:void();">
|
||||
<%= image_tag(url_to_avatar(item), :style=>"width:64px;height:64px;",:alt=>"头像") %>
|
||||
</a>
|
||||
</div>
|
||||
<div class="courses_list_info fl ml10">
|
||||
<a href="<%= user_path(item) %>" title="<%= item.show_name %>" class="courses_list_title f14 fb c_blue02 fl"><%= item.show_name %></a>
|
||||
<div class="cl"></div>
|
||||
<div class="courses_list_table ">
|
||||
<% if item.user_extensions && !item.user_extensions.brief_introduction.nil? && !item.user_extensions.brief_introduction.empty? %>
|
||||
<p class="fans_sign" title="<%= item.user_extensions.brief_introduction %>">个性签名:<%= item.user_extensions.brief_introduction %></p>
|
||||
<% end %>
|
||||
<table><tbody><tr>
|
||||
<td class="td_w60 ">加入时间:</td>
|
||||
<td class="td_w110 "><%= format_date(item.created_on) %></td>
|
||||
<% if (item.user_extensions.identity == 0 || item.user_extensions.identity == 1) && !item.user_extensions.school.nil? %>
|
||||
<td class="td_w60 ">工作单位:</td>
|
||||
<td class="td_w110 ">
|
||||
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= item.user_extensions.school.name %>">
|
||||
<a href="<%= url_for(:controller=>'welcome',:action => 'course', :school_id => item.user_extensions.school.id,:host=>Setting.host_course) %>"><%= item.user_extensions.school.name %></a>
|
||||
</li>
|
||||
</td>
|
||||
<% elsif item.user_extensions.identity == 3 && !item.user_extensions.occupation.nil? && !item.user_extensions.occupation.empty? %>
|
||||
<td class="td_w60 ">工作单位:</td>
|
||||
<td class="td_w110 ">
|
||||
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= item.user_extensions.occupation %>">
|
||||
<%= item.user_extensions.occupation %>
|
||||
</li>
|
||||
</td>
|
||||
<% elsif item.user_extensions.identity == 2 %>
|
||||
<td class="td_w60 ">工作单位:</td>
|
||||
<td class="td_w110 ">
|
||||
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= item.show_name %>">
|
||||
<%= item.show_name %>
|
||||
</li>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr></tbody></table>
|
||||
</div>
|
||||
</div>
|
||||
<% if(User.current.logged? && User.current != item )%>
|
||||
<%if(item.watched_by?(User.current))%>
|
||||
<a href="<%= watch_path(:object_type=>'user',:object_id=>item.id,:target_id=>target.id) %>" class="grey_n_btn fr mt20" data-method="delete" data-remote="true" title="取消关注">取消关注</a>
|
||||
<% else %>
|
||||
<a href="<%= watch_path(:object_type=>'user',:object_id=>item.id,:target_id=>target.id) %>" class="blue_n_btn fr mt20" data-method="post" data-remote="true" title="添加关注">添加关注</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
@ -1,3 +1,4 @@
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_new_score') %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
$('#ajax-modal').siblings().show();
|
||||
$('#ajax-modal').addClass('new-watcher');
|
||||
|
@ -0,0 +1,19 @@
|
||||
<% for rec in @list %>
|
||||
<div class="users_courses_list" nhname="rec" data-id="<%= rec[:item].id %>">
|
||||
<span class="fl" style="width:180px;">
|
||||
<a href="<%= get_activity_container_url(rec[:e]) %>" class=" fl users_coursename ml5" title="<%= rec[:e].name %>">
|
||||
<%= rec[:e].name %>
|
||||
</a>
|
||||
<%# if( rec[:e].is_public == false || rec[:e].is_public == 0 ) %>
|
||||
<!--<font class="img_private">私有</font>-->
|
||||
<%# end %>
|
||||
</span>
|
||||
<a href="<%= user_path(rec[:item].user.id) %>" class="c_orange course_name fl mr5" title="<%= rec[:item].user.show_name %>"><%= rec[:item].user.show_name %></a>
|
||||
<span class="fl mr5 c_grey"><%= get_activity_opt(rec[:item],rec[:e]) %></span>
|
||||
<a href="<%= get_activity_url(rec[:item],rec[:e]) %>"
|
||||
class="c_blue02 fl users_courses_txt hidepic" title="<%= get_activity_act_showname(rec[:item]) %>">
|
||||
<%= get_activity_act_showname_htmlclear(rec[:item]) %>
|
||||
</a>
|
||||
<span class="fr c_grey mr10"><%= time_tag(get_activity_act_createtime(rec[:item])).html_safe %></span>
|
||||
</div>
|
||||
<% end %>
|
@ -1,33 +1,31 @@
|
||||
<% if @user.user_extensions.identity == UserExtensions::TEACHER %>
|
||||
<%= render :partial => 'my_course' %>
|
||||
<% else %> <!--for student-->
|
||||
<%= render :partial => 'my_joinedcourse' %>
|
||||
<% end %>
|
||||
<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function($) {
|
||||
$("#content .content_frame").find("a").attr("target", "_blank");
|
||||
$("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>
|
||||
<div class="top_new">
|
||||
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
|
||||
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
|
||||
<a href="<%= url_for(:controller => 'courses', :action => 'new',) %>" class="green_n_btn fr mt2" target="_blank">新建课程</a>
|
||||
<% else %>
|
||||
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var $menu = $('.user_course_list .menu');
|
||||
var $li_tags = $menu.find('[mode]');
|
||||
var $dyn_list = $('.dyn_list_wrapper');
|
||||
|
||||
$menu.find('[mode]').each(function(index, el) {
|
||||
$(el).click(function() {
|
||||
mode = $(el).attr('mode');
|
||||
$menu.find('[mode]').removeClass( "on" );
|
||||
$( this ).addClass( "on" );
|
||||
var wrapper = $('[mode='+mode+']')
|
||||
$dyn_list.addClass( "hidden" );
|
||||
wrapper.removeClass('hidden')
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% html_title(l(:label_user_course)) -%>
|
||||
<div id="RSide" class="fl">
|
||||
<div class="courses_box">
|
||||
<div class="courses_top mb10">
|
||||
<h2 class="courses_h2 fl">所有课程</h2>
|
||||
<div class="courses_select fr">
|
||||
<a href="<%= url_for(:controller => 'users', :action => 'user_courses')%>" class="select_btn <%= (@params['status']!='1' && @params['status']!='2') ? 'select_btn_select' : '' %> fl "> 全部</a>
|
||||
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'1')%>" class="select_btn <%= (@params['status']=='1') ? 'select_btn_select' : '' %> fl ">正在进行</a>
|
||||
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'2')%>" class="select_btn <%= (@params['status']=='2') ? 'select_btn_select' : '' %> fl "> 已经结束</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% for item in @list %>
|
||||
<%= render :partial => 'course_form', :locals => {:item => item} %>
|
||||
<% end %>
|
||||
<p class="nodata" style="display:<%= @list.count > 0 ? 'none' : 'block' %>;"><%= l(:label_no_data) %></p>
|
||||
</div>
|
||||
<ul class="wlist" style=" border:none;">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
@ -0,0 +1,16 @@
|
||||
<% for item in @list %>
|
||||
|
||||
<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>
|
||||
<span class="fl" style="width:260px;">
|
||||
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" class="home_list_title c_blue02 fl mb10" title="<%= item.name %>"><%= item.name %></a>
|
||||
</span>
|
||||
<div class="fl c_dgrey">
|
||||
<p>主讲老师:<a href="<%= user_path(item.teacher) %>" title="<%= item.teacher.show_name %>"><%= item.teacher.show_name %></a></p>
|
||||
<p>课程作业:<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>"><%= item.homework_commons.count %></a> <span class="ml10"></span>学生:<a href="<%= url_for(:controller => 'courses', :action=>"member", :id=>item.id,:role=>2, :host=>Setting.host_course) %>"><%= studentCount(item) %></a></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
@ -0,0 +1,36 @@
|
||||
<% for item in feed_list %>
|
||||
<div class="message_list" id="nh_jours_<%= item.id %>" nhname="rec" data-id="<%= item.id %>">
|
||||
<a href="<%= user_path(item.user) %>" class="users_pic fl">
|
||||
<%= image_tag url_to_avatar(item.user),:width => '27',:height => '27' %>
|
||||
</a>
|
||||
<a href="<%= user_path(item.user) %>" title="<%= item.user.show_name %>" class="course_name fl c_blue02 ml5 mt5"><%= item.user.show_name %></a>
|
||||
<% if item.at_user %>
|
||||
<span class="fl c_dark mt5"> 回复</span>
|
||||
<a href="<%= user_path(item.at_user) %>" title="<%= item.at_user.show_name %>" class="course_name fl c_blue02 ml5 mt5"><%= item.at_user.show_name %></a>
|
||||
<% end %>
|
||||
<span class="fl c_dark mt5"> : </span>
|
||||
<div class="massage_txt fl mt5"><%=item.notes.html_safe%></div>
|
||||
<% if JournalsForMessage.create_by_user? User.current %>
|
||||
<a href="javascript:void(0)" nhname='reply_btn' class="fl mt5 c_purple ml5">回复</a>
|
||||
<% end %>
|
||||
<% if User.current.admin? || item.user.id == User.current.id %>
|
||||
<a href="<%= url_for(:controller => 'words', :action=>"destroy", :object_id=>item.id,:user_id=>item.user.id) %>" data-confirm="您确定要删除吗?" data-remote="true" data-method="delete" class="fl mt5 c_purple ml5">删除</a>
|
||||
<% end %>
|
||||
<span class="massage_time fr"><%= time_tag(item.created_on).html_safe %></span>
|
||||
<div class="cl"></div>
|
||||
<div nhname='div_form' class="mt10 ml80" style="display:none;">
|
||||
<form action="<%= url_for(:controller => 'words', :action => 'create_reply') %>" data-remote="true" method="post">
|
||||
<input id="reference_id" name="reference_id" type="hidden" value="<%= (item.m_parent_id.nil? || item.m_parent_id==0 ) ? item.id : item.m_parent_id %>">
|
||||
<input id="reference_user_id" name="reference_user_id" type="hidden" value="<%= item.user.id %>">
|
||||
<input id="reference_message_id" name="reference_message_id" type="hidden" value="<%= item.id %>">
|
||||
<input id="show_name" name="show_name" type="hidden" value="true">
|
||||
<textarea name='user_notes' style="display:none;"></textarea>
|
||||
<p nhname='contentmsg'></p>
|
||||
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
|
||||
<a nhname="cancel_btn" href="javascript:;" class="grey_n_btn fr" style="margin-top:3px;">取消</a>
|
||||
<a nhname="submit_btn" href="javascript:;" class="blue_n_btn fr mr5" style="margin-top:3px;">发布</a>
|
||||
</form>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
@ -1,66 +1,56 @@
|
||||
<!--add by huang-->
|
||||
|
||||
<!--span class="font_lighter" >温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~</span-->
|
||||
<div class="menu-div">
|
||||
<div class="menu">
|
||||
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
|
||||
<ul><%#链接绑定在页面最下方的jQuery%>
|
||||
<li mode='take' class="<%= "on" if @state.eql?(0)%>"><%=l :label_project_take%></li>
|
||||
<li mode='watched' class="<%= "on" if @state.eql?(1)%>"><%=l :label_has_watched_project%></li>
|
||||
</ul>
|
||||
<div class="top_new">
|
||||
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
|
||||
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
|
||||
<a href="<%= url_for(:controller => 'projects', :action => 'new') %>" class="bgreen_n_btn fr ml10 mt2" target="_blank">新建项目</a>
|
||||
<% else %>
|
||||
<a href="<%= join_project_projects_path %>" data-remote ="true" class="green_n_btn fr mt2">加入项目</a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:20px"></div>
|
||||
|
||||
<%#= watch_projects @state %>
|
||||
<% unless @memberships.empty? %>
|
||||
<div class="content_frame">
|
||||
<ul class="user_project_sort">
|
||||
<% for membership in @memberships %>
|
||||
<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.project), :class => 'avatar') %></td>
|
||||
<td>
|
||||
<table width="580" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong> <%= link_to_user(membership.user) if membership.respond_to?(:user) %></strong>
|
||||
<span class="font_lighter"> <%= l(:label_project_take_in) %></span> <%= link_to_project(membership.project) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
|
||||
<p class="font_description">
|
||||
<%= membership.project.short_description%>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><span class="font_lighter"><%= l(:label_create_time) %> : <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
|
||||
<td align="right" ><%= h membership.roles.sort.collect(&:to_s).join(', ') %> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<% if @user != User.current %>
|
||||
<p class="font_description"><%= l(:label_project_un) %></p>
|
||||
<% else %>
|
||||
<p class="font_description"><%= l(:label_project_unadd) %></p>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<%= call_hook :view_account_left_bottom, :user => @user %>
|
||||
</div>
|
||||
<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function($) {
|
||||
$("#content .tabs_new~").find("a").attr("target", "_blank");
|
||||
$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
|
||||
$('[mode=take]').click(function(event) {window.location.href='<%=user_projects_user_url%>'; });
|
||||
$('[mode=watched]').click(function(event) {window.location.href='<%=watch_projects_user_url(type: 1)%>'; });
|
||||
});
|
||||
</script>
|
||||
<% html_title(l(:label_user_project)) -%>
|
||||
<div id="RSide" class="fl">
|
||||
<div class="courses_box">
|
||||
<div class="courses_top mb10">
|
||||
<h2 class="courses_h2 fl">全部项目</h2>
|
||||
<div class="courses_select fr">
|
||||
<a href="<%= url_for(:controller => 'users', :action => 'user_projects')%>" class="select_btn <%= (@params['status']!='1' && @params['status']!='2') ? 'select_btn_select' : '' %> fl "> 全部</a>
|
||||
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'1')%>" class="select_btn <%= (@params['status']=='1') ? 'select_btn_select' : '' %> fl ">我创建</a>
|
||||
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'2')%>" class="select_btn <%= (@params['status']=='2') ? 'select_btn_select' : '' %> fl "> 我参与</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% for item in @list %>
|
||||
<% creator = User.find(item.user_id)%>
|
||||
<div class="courses_list line">
|
||||
<div class="courses_list_pic fl"><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>
|
||||
<div class="courses_list_info fl ml10">
|
||||
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>" class="courses_list_title f14 fb c_blue02 fl" title="<%= item.name %>"><%= item.name %></a>
|
||||
<div class="cl"></div>
|
||||
<div class="courses_list_table ">
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<td class="td_w60 ">创建者:</td>
|
||||
<td class="td_w70 "><a href="<%= user_path(creator) %>" title="<%= creator.show_name %>"><%= creator.show_name %></a></td>
|
||||
<td class="td_w60 ">创建时间:</td>
|
||||
<td class="td_w110 "><%= format_date(item.created_on) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成员人数:</td>
|
||||
<td><a href="<%= url_for(:controller => 'projects', :action=>"member", :id=>item.id, :host=>Setting.host_name) %>"><%= item.members.count %></a></td>
|
||||
<td>项目类型:</td>
|
||||
<td><%= item.project_new_type == 1 ? l(:label_development_team) : (item.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</div>
|
||||
</div>
|
||||
<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 %>
|
||||
<p class="nodata" style="display:<%= @list.count > 0 ? 'none' : 'block' %>;"><%= l(:label_no_data) %></p>
|
||||
</div>
|
||||
<ul class="wlist" style=" border:none;">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
@ -0,0 +1,16 @@
|
||||
<% for item in @list %>
|
||||
<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>
|
||||
<span class="fl" style="width:260px;">
|
||||
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>" class="home_list_title c_blue02 fl mb10" title="<%= item.name %>"><%= item.name %></a>
|
||||
</span>
|
||||
<div class="fl c_dgrey">
|
||||
<!--<p>项目评分:<a href="<%#= url_for(:controller => 'projects', :action => 'show_projects_score', :id => item.id,:host=>Setting.host_name) %>" data-remote="true"><%#= format( "%.2f" , project_scores(item) ).to_i %></a></p>-->
|
||||
<p>项目评分:<a href="<%= url_for(:controller => 'projects', :action => 'show_projects_score', :id => item.id) %>" data-remote="true"><%= format( "%.2f" , project_scores(item) ).to_i %></a></p>
|
||||
<p>发布缺陷:<a href="<%= url_for(:controller => 'issues', :action=>"index", :project_id=>item.id, :host=>Setting.host_name) %>"><%= item.issues.count %></a> <span class="ml10"></span>成员:<a href="<%= url_for(:controller => 'projects', :action=>"member", :id=>item.id, :host=>Setting.host_name) %>"><%= item.members.count %></a></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
@ -1,11 +1,70 @@
|
||||
<% if( params[:object_type] == 'user') %>
|
||||
<% if( params[:target_id] == params[:object_id] ) %>
|
||||
<% target = User.find_by_id(params[:target_id]) %>
|
||||
//btn
|
||||
var btn_html = "<%= escape_javascript( render( :partial => 'layouts/user_watch_btn', :locals => {:target => target} ) )%>";
|
||||
$('#user_watch_id').replaceWith(btn_html);
|
||||
//count
|
||||
$("*[nh_name='fans_count']").html("<%= target.watcher_users.count.to_s %>");
|
||||
//left list
|
||||
var list_left_html = "<%= escape_javascript( render( :partial => 'layouts/user_fans_list', :locals => {:user => target} ) )%>";
|
||||
$('#fans_nav_list').replaceWith(list_left_html);
|
||||
//list
|
||||
if( $("#nh_fans_list") != undefined && $("#nh_fans_list").length != 0 ){
|
||||
<% if( opt == 'add') %>
|
||||
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>User.current,:target => target} ) )%>";
|
||||
$("#nh_fans_list").after(list_html);
|
||||
$("#nodata").hide();
|
||||
<% else %>
|
||||
$("#fans_item_<%= User.current.id %>",$("#nh_fans_list").parent('div')).remove();
|
||||
if( $('>div',$("#nh_fans_list").parent('div')).length == 1 ){
|
||||
$("#nodata").show();
|
||||
}
|
||||
<% end %>
|
||||
}
|
||||
|
||||
<% elsif( params[:target_id] == User.current.id.to_s )%>
|
||||
<% target = User.find_by_id(params[:target_id]) %>
|
||||
<% item = User.find_by_id(params[:object_id]) %>
|
||||
//count
|
||||
$("*[nh_name='watcher_count']").html("<%= User.watched_by(target.id).count.to_s %>");
|
||||
//left list
|
||||
var list_left_html = "<%= escape_javascript( render( :partial => 'layouts/user_watch_list', :locals => {:user => target} ) )%>";
|
||||
$('#watcher_nav_list').replaceWith(list_left_html);
|
||||
//list
|
||||
if( $("#nh_wacth_list") != undefined && $("#nh_wacth_list").length != 0 ){
|
||||
<% if( opt == 'delete') %>
|
||||
$("#fans_item_<%= item.id %>",$("#nh_wacth_list").parent('div')).remove();
|
||||
if( $('>div',$("#nh_wacth_list").parent('div')).length == 1 ){
|
||||
$("#nodata").show();
|
||||
}
|
||||
<% end %>
|
||||
}else if($("#nh_fans_list") != undefined && $("#nh_fans_list").length != 0){
|
||||
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>item,:target => target} ) )%>";
|
||||
$('#fans_item_<%= item.id %>').replaceWith(list_html);
|
||||
}
|
||||
|
||||
<% else %>
|
||||
<% target = User.find_by_id(params[:target_id]) %>
|
||||
<% item = User.find_by_id(params[:object_id]) %>
|
||||
//list
|
||||
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>item,:target => target} ) )%>";
|
||||
$('#fans_item_<%= item.id %>').replaceWith(list_html);
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
|
||||
<% selector = ".#{watcher_css(watched)}" %>
|
||||
<% id_selector = "#{watcher_css(watched)}" %>
|
||||
if($("<%= selector %>").get(0) == undefined)
|
||||
{
|
||||
$("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link_for_project(watched, user) %>")});
|
||||
$("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link_for_project(watched, user) %>")});
|
||||
}
|
||||
else
|
||||
{
|
||||
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
|
||||
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
|
||||
}
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
|
@ -1,9 +1,15 @@
|
||||
//$('#message').html('<#%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages,:show_name => true})) %>');
|
||||
//$('#message').html('<%#= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages,:show_name => true})) %>');
|
||||
<% if !@jour.nil? && @jour.jour_type == 'Principal' %>
|
||||
var html = $("<div>"+"<%= escape_javascript( render(:template => 'users/user_feedback4show',:locals => {:feed_list=>[@jour]} )) %>"+"</div>");
|
||||
$("div[nhname='container']",$("#nh_messages")).prepend(html.html());
|
||||
$('#new_message_cancel_btn').click();
|
||||
var params = init_list_more_div_params($("#nh_messages"));
|
||||
change_status_4_list_more_div(params);
|
||||
|
||||
<% else %>
|
||||
$('#history').html('<%= escape_javascript(render(:partial => 'users/history',:locals => { :journals => @jour, :state => false})) %>')
|
||||
$('#jour_count').html('<%= @obj_count%>')
|
||||
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
|
||||
$('#new_form_user_message').val("");
|
||||
if($('#new_message_cancel_btn') != undefined && $('#new_message_cancel_btn').length!=0){
|
||||
$('#new_message_cancel_btn').click();
|
||||
}
|
||||
$('#new_form_reference_user_id').val("");
|
||||
$('#new_form_reference_user_id').val("");
|
||||
<% end %>
|
||||
|
@ -1,18 +1,26 @@
|
||||
<% if @journal_destroyed.nil? %>
|
||||
alert('<%=l(:notice_failed_delete)%>');
|
||||
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
|
||||
<% if @bid && @jours_count %>
|
||||
$('#jours_count').html("<%= @jours_count %>");
|
||||
<% elsif @course && @jours_count%>
|
||||
$('#course_jour_count').html("(<%= @jours_count %>)");
|
||||
<% elsif @user && @jours_count%>
|
||||
$('#jour_count').html("<%= @jours_count %>");
|
||||
<% if @is_user%>
|
||||
$("#nh_jours_<%= @journal_destroyed.id %>",$("div[nhname='container']",$("#nh_messages"))).remove();
|
||||
var params = init_list_more_div_params($("#nh_messages"));
|
||||
change_status_4_list_more_div(params);
|
||||
<% else %>
|
||||
<% if @bid && @jours_count %>
|
||||
$('#jours_count').html("<%= @jours_count %>");
|
||||
<% elsif @course && @jours_count%>
|
||||
$('#course_jour_count').html("(<%= @jours_count %>)");
|
||||
<% elsif @user && @jours_count%>
|
||||
$('#jour_count').html("<%= @jours_count %>");
|
||||
<% end %>
|
||||
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
|
||||
destroyedItem.fadeOut(600,function(){
|
||||
destroyedItem.remove();
|
||||
});
|
||||
|
||||
<% end %>
|
||||
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
|
||||
destroyedItem.fadeOut(600,function(){
|
||||
destroyedItem.remove();
|
||||
});
|
||||
<% else %>
|
||||
$('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>');
|
||||
$('#new_form_reference_user_id').val("");
|
||||
<% end %>
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
class AddProportionToPrograming < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :homework_detail_programings, :ta_proportion, :float, :default => 0.1
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :homework_detail_programings, :ta_proportion
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
class ChangeStudenWorkDesc < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :student_works,:description,:text,:limit => 4294967295
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :student_works,:description,:text
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
class AddQuestionIdToHomework < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :homework_detail_programings, :question_id, :integer
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :homework_detail_programings, :question_id
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
class AddDescriptionToUserExtensions < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :user_extensions, :description, :string, default: ''
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :user_extensions, :description
|
||||
end
|
||||
end
|
@ -0,0 +1,14 @@
|
||||
class CreateVisitors < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :visitors do |t|
|
||||
t.integer :user_id
|
||||
t.integer :master_id
|
||||
t.datetime :updated_on
|
||||
t.datetime :created_on
|
||||
|
||||
end
|
||||
add_index "visitors", ["user_id"], :name => "index_visitors_user_id"
|
||||
add_index "visitors", ["master_id"], :name => "index_visitors_master_id"
|
||||
add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on"
|
||||
end
|
||||
end
|
@ -0,0 +1,11 @@
|
||||
class AddActivityContainerTypeToActivities < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :activities, :activity_container_id, :int
|
||||
add_column :activities, :activity_container_type, :string, default: ''
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :activities, :activity_container_type
|
||||
remove_column :activities, :activity_container_id
|
||||
end
|
||||
end
|
@ -0,0 +1,14 @@
|
||||
class CreateTestResult < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :student_work_tests do |t|
|
||||
t.integer :student_work_id
|
||||
t.integer :homework_test_id
|
||||
t.integer :result
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :student_work_tests
|
||||
end
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
class ChangeActivitiesContainerType < ActiveRecord::Migration
|
||||
def up
|
||||
activities = Activity.where("activity_container_type = ''")
|
||||
activities.each do |activity|
|
||||
activity.set_container_type_val
|
||||
activity.save
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
Activity.where("activity_container_type <> ''").update_all(activity_container_type: '',activity_container_id:nil)
|
||||
end
|
||||
end
|
@ -0,0 +1,22 @@
|
||||
class CreateDts < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :dts do |t|
|
||||
t.string :IPLineCode
|
||||
t.string :Description
|
||||
t.string :Num
|
||||
t.string :Variable
|
||||
t.string :TraceInfo
|
||||
t.string :Method
|
||||
t.string :File
|
||||
t.string :IPLine
|
||||
t.string :Review
|
||||
t.string :Category
|
||||
t.string :Defect
|
||||
t.string :PreConditions
|
||||
t.string :StartLine
|
||||
t.integer :project_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 9.7 KiB |
@ -0,0 +1,67 @@
|
||||
.topbar_info02{ margin:5px 10px;width:480px; }
|
||||
.topbar_info02 p{color: #7f7f7f;}
|
||||
.search{ margin-top:8px; float:right; margin-right:5px;}
|
||||
/*信息*/
|
||||
.project_info{ background:#fff; padding:10px; padding-right:0px;width:222px; padding-right:8px; margin-bottom:10px;}
|
||||
.pr_info_id{ width:137px; color:#5a5a5a; font-size:14px; margin-top:5px;}
|
||||
.pr_info_logo{ border:1px solid #eaeaea; width:60px; height:60px; padding:1px;}
|
||||
.pr_info_logo:hover{ border:1px solid #64bdd9; }
|
||||
.pr_info_join{}
|
||||
a.pr_join_a{ color:#fff; display:block; padding:0 5px 0 3px; padding-top:2px; height:20px; margin-right:5px; float:left; text-align:center; background-color:#64bdd9; float:left; }
|
||||
a:hover.pr_join_a{ background:#41a8c8;}
|
||||
.pr_join_span{color: #fff; display:block; padding:0 5px; padding-top:2px; height:20px; margin-right:5px; float:left; text-align:center; background: #CCC;}
|
||||
.pr_setting{ display:block; background:url(../images/leftside.png) -1px 0 no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
|
||||
.pr_copy{ display:block; background:url(../images/leftside.png) -1px -23px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
|
||||
.pr_close{ display:block; background:url(../images/leftside.png) -1px -49px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
|
||||
.pr_add{display:block; background:url(../images/leftside.png) 0px -71px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
|
||||
.pr_arrow{display:block; background:url(../images/leftside.png) 0px -90px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
|
||||
.pr_info_name{ color:#3e4040; font-size:14px; line-height:1.5;}
|
||||
.pr_info_name:hover{ color:#3ca5c6;}
|
||||
.pr_info_score{ font-size:14px; color:#3e4040; }
|
||||
.pr_info_score a{ color:#ff7143;}
|
||||
.pr_info_score a:hover{ color:#64bdd9;}
|
||||
|
||||
.img_private{ background:url(../images/new_project/img_project.png) 0 0 no-repeat; width:33px; height:16px; color:#fff; font-size:12px; padding-left:7px; }
|
||||
/*.img_private{ background:url(../images/project/img_project.png) 0 0 no-repeat; width:33px; height:16px; color:#fff; font-size:12px; padding-left:7px; }*/
|
||||
.info_foot_num{ color:#3ca5c6; }
|
||||
.pr_info_foot{ color:#7f7f7f; margin-top:5px; }
|
||||
.info_foot_num:hover{ color:#2390b2;}
|
||||
.info_box{background:#fff; padding:10px;width:220px; }
|
||||
.info_box ul li{ font-size:12px; color: #3e4040; line-height:1.7;}
|
||||
|
||||
/*左侧导航*/
|
||||
.subNavBox{width:240px; background:#fff;margin:10px 10px 0 0;}
|
||||
.subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6; height:26px;padding-left:10px;background-color:#fff; padding-top:2px;}
|
||||
.subNav_jiantou{background:url(../images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;}
|
||||
.subNav_jiantou:hover{color:#0781b4; }
|
||||
.currentDd{color:#0781b4;}
|
||||
.currentDt{background-color:#fff;}
|
||||
.navContent{display: none;border-bottom:solid 1px #e5e3da; }
|
||||
.navContent li a{display:block;width:240px;heigh:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
|
||||
.navContent li a:hover{color:#fff;background-color:#b3e0ee}
|
||||
a.subnav_num{ font-weight:normal; color:#ff7143; font-size:12px;}
|
||||
a.subnav_green{ background:#28be6c; color:#fff; font-size:12px; font-weight:normal;height:18px; padding:0px 5px; padding-top:2px; display:block; margin-top:2px; margin-bottom:5px; float:right; margin-right:5px;}
|
||||
a:hover.subnav_green{ background:#14ad5a;}
|
||||
|
||||
|
||||
/*简介*/
|
||||
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
|
||||
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
|
||||
.course_description_none{max-height: none;}
|
||||
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;}
|
||||
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}
|
||||
/****标签(和资源库的tag样式一致)***/
|
||||
.project_Label{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; margin-bottom:10px;}
|
||||
a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
|
||||
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
|
||||
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
|
||||
.re_tag{ width: auto; padding:0 5px; padding-top:2px; height:20px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; }
|
||||
.re_tag a{ color:#0d90c3;}
|
||||
.tag_h{ }
|
||||
.tag_h span,.tag_h a{ margin-bottom:5px;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue