Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
8886bda790
|
@ -101,8 +101,9 @@ class BoardsController < ApplicationController
|
|||
@topic_count = @board ? @board.topics.count : 0
|
||||
if @project
|
||||
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||
#现在发布帖子的时候置顶功能已经没有了。所以取消这个置顶排序 #{Message.table_name}.sticky DESC,
|
||||
@topics = @board.topics.
|
||||
reorder("#{Message.table_name}.sticky DESC, #{Message.table_name}.created_on desc").
|
||||
reorder("#{Message.table_name}.created_on desc").
|
||||
includes(:last_reply).
|
||||
limit(@topic_pages.per_page).
|
||||
offset(@topic_pages.offset).
|
||||
|
|
|
@ -2356,8 +2356,8 @@ module ApplicationHelper
|
|||
if work.nil?
|
||||
link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
||||
else
|
||||
if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
|
||||
link_to "作品已交", "", :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
|
||||
link_to "作品已交", "javascript:void(0)", :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
||||
elsif homework.homework_type == 2 #编程作业不能修改作品
|
||||
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
||||
else
|
||||
|
|
|
@ -4,6 +4,6 @@ class HomeworkDetailPrograming < ActiveRecord::Base
|
|||
belongs_to :homework_common
|
||||
|
||||
def language_name
|
||||
%W(C C++ Python).at(self.language.to_i - 1)
|
||||
%W(C C++ Python Java).at(self.language.to_i - 1)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'talk_edit fr',
|
||||
:style => ' margin-right: 10px;') if topic.destroyable_by?(User.current) %>
|
||||
<% if topic.sticky? %>
|
||||
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
|
||||
<% end %>
|
||||
<%# if topic.sticky? %>
|
||||
<!--<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%#= l(:label_board_sticky)%></a>-->
|
||||
<%# end %>
|
||||
<script>
|
||||
//$(function(){if($("#contentmessage<%#=topic.id %>").height()>182){$("#project_show_<%#= topic.id%>").show();}});
|
||||
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
|
||||
|
|
|
@ -223,6 +223,7 @@
|
|||
});
|
||||
|
||||
}
|
||||
<% if @course %>
|
||||
var tagNameHtml; //当前双击的链接的父节点的html
|
||||
var tagName; //标签的值
|
||||
var parentCssBorder; //当前双击的链接的父节点
|
||||
|
@ -271,6 +272,7 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
<%end %>
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@
|
|||
<span class="postEdit">
|
||||
</span>
|
||||
<a href="<%= edit_forum_path(@forum) %>" class="linkGrey3">编辑贴吧</a>
|
||||
<a href="<%= forum_path(@forum)%>" data-method="delete" onclick="return confirm('您确定要删除么?');" class="fr linkGrey3">删除贴吧</a>
|
||||
<a href="<%= forum_path(@forum)%>" data-method="delete" onclick="return confirm('您确定要删除么?');" class="fr linkGrey3">删除贴吧</a>
|
||||
<span class="postDelete"></span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<div class="fl fontGrey3" style="word-break:normal; width:auto; display:block; white-space:pre-wrap;word-wrap : break-word ;overflow: hidden ;">
|
||||
<div class="fl fontGrey3" class="memo-content">
|
||||
<%= @memo.content.html_safe%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<li class="hworkList340 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
|
||||
<ul>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= link_to(image_tag(url_to_avatar(User.current),:width =>"40",:height => "40"),user_activities_path(User.current.id))%>
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40"),user_activities_path(User.current.id))%>
|
||||
</li>
|
||||
<div onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<li class="hworkName mt15 mr15 <%= @homework.homework_type == 2 ? '' : 'width165'%>">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div class="HomeWorkCon">
|
||||
<div class="mt15">
|
||||
<select class="InputBox W120 language_type" >
|
||||
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
|
||||
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3, "Java"=>4}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
|
||||
</select>
|
||||
</div>
|
||||
<% if edit_mode && homework.is_program_homework? %>
|
||||
|
|
|
@ -368,7 +368,7 @@
|
|||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<% if ma.course_message.reviewer_role == 3 %>
|
||||
匿名用户
|
||||
<span class="newsBlue homepageNewsPublisher">匿名用户</span>
|
||||
<% else %>
|
||||
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
1709
db/schema.rb
1709
db/schema.rb
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
@ -153,6 +153,8 @@ $(function(){
|
|||
language = 'C++';
|
||||
}else if($('select.language_type').val() == 3){
|
||||
language = 'Python';
|
||||
}else if($('select.language_type').val() == 4){
|
||||
language = 'Java';
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
|
@ -199,8 +201,81 @@ $(function(){
|
|||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
|
||||
if ($('#program-src').val().length<=0) {
|
||||
var src = '';
|
||||
if(language==4){
|
||||
src = '\
|
||||
import java.io.*;\n\
|
||||
import java.util.*;\n\
|
||||
\n\
|
||||
//请一定不要修改类名\n\
|
||||
class Main\n\
|
||||
{\n\
|
||||
public static void main (String args[])\n\
|
||||
{\n\
|
||||
//获取参数方式\n\
|
||||
//Scanner in = new Scanner(System.in);\n\
|
||||
//int a = in.nextInt();\n\
|
||||
//int b = in.nextInt();\n\
|
||||
\n\
|
||||
//您的代码\n\
|
||||
}\n\
|
||||
}\n\
|
||||
';
|
||||
}
|
||||
else if(language==1){
|
||||
src = '#include <stdio.h>\n\
|
||||
\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 scanf\n\
|
||||
//int x =0;\n\
|
||||
//int y = 0;\n\
|
||||
//scanf("%d", &x);\n\
|
||||
\n\
|
||||
//结果输出使用prinf\n\
|
||||
//printf("%d",x);\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==2){
|
||||
src = '\
|
||||
#include <iostream>\n\
|
||||
using namespace std;\n\
|
||||
\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 cin\n\
|
||||
//int x =0;\n\
|
||||
//cin >> x;\n\
|
||||
\n\
|
||||
//结果输出使用 cout\n\
|
||||
//cout<<"1";\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==3){
|
||||
src = '\
|
||||
import sys \n\
|
||||
\n\
|
||||
#获取参数方式,使用raw_input\n\
|
||||
#input = raw_input()\n\
|
||||
#a, b = input.split()\n\
|
||||
\n\
|
||||
#结果输出使用 print \n\
|
||||
#print (str(int(a)+int(b)))\n\
|
||||
';
|
||||
}
|
||||
|
||||
$('#program-src').val(src);
|
||||
};
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("program-src"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
|
|
|
@ -354,6 +354,25 @@ function limitStrsize(id,length){
|
|||
event.returnValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////创建项目
|
||||
//验证项目名称是不是为空
|
||||
function regex_project_name(){
|
||||
var name = $.trim($("#project_name").val());
|
||||
if(name=="")
|
||||
{
|
||||
$("#project_name_error_msg").text("项目名称不能为空");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#project_name_error_msg").text("");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//验证项目名称是否重复---项目名称可以重复。。。。
|
||||
function regex_project_name_same(){
|
||||
var name = $.trim($("#project_name").val());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
|
|||
.pingBoxTit{ float:left; width:625px; margin-left:10px;}
|
||||
.pingText{border:1px solid #CCCCCC; margin:5px; padding:5px; width:610px; height:20px; }
|
||||
.pingBackTit{ float:left; width:573px; margin-left:10px; }
|
||||
.hworkUl{ height:30px; border-bottom:1px solid #eaeaea; line-height:30px; vertical-align:middle; padding-bottom:5px;}
|
||||
.hworkUl{ height:30px; border-bottom:1px solid #eaeaea; line-height:30px; vertical-align:middle;}
|
||||
.hworkH30 {height:30px !important; line-height:30px !important;}
|
||||
.hworkListRow {height:65px; border-bottom:1px solid #eaeaea; line-height:65px; vertical-align:middle;}
|
||||
.hworkListRow:hover {background-color:#f6f6f7;}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 13 KiB |
|
@ -406,6 +406,7 @@ a.sendButtonBlue:hover {color:#ffffff;}
|
|||
}
|
||||
a.resourcesTypeAll {background:url(images/homepage_icon.png) -180px -89px no-repeat; padding-left:23px;}
|
||||
a.resourcesTypeAtt {background:url(images/homepage_icon.png) -180px -49px no-repeat; padding-left:23px;}
|
||||
a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-repeat; padding-left:23px;}
|
||||
.resourcesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-90px; font-size:12px; color:#888888; display:none; line-height:2;}
|
||||
/*.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#64bdd9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;}*/
|
||||
/*.resourcesUploadBox:hover {background-color:#0781b4;}*/
|
||||
|
@ -547,7 +548,7 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
|
|||
.homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin-left:10px;}
|
||||
.homepageNewsPortrait {width:40px; display:block; margin-top:7px;}
|
||||
.homepageNewsPublisher { max-width:100px; font-size:12px; color:#269ac9; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; }
|
||||
.homepageNewsType {width:110px; padding-left: 5px; font-size:12px; color:#888888; display:block;}
|
||||
.homepageNewsType {padding-left: 5px; font-size:12px; color:#888888; display:block;}
|
||||
.homepageNewsTypeHomework {width:160px; padding-left: 5px; font-size:12px; color:#888888; display:block; overflow:hidden; height:49px;word-break:break-all; word-wrap:break-word; text-overflow:ellipsis;}
|
||||
.homepageNewsPubType {width:220px; font-size:12px; color:#888888; display: block;}
|
||||
.homepageNewsPubTypeHomework {width:270px; font-size:12px; color:#888888; display: block; white-space:nowrap;}
|
||||
|
|
Loading…
Reference in New Issue