Merge branch 'szzh' into dev_hjq

This commit is contained in:
huang 2015-09-25 11:46:54 +08:00
commit d21ffcf7ff
26 changed files with 2363 additions and 553 deletions

View File

@ -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).

View File

@ -73,7 +73,7 @@ class JournalsController < ApplicationController
text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
@content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n"
@content << text.gsub(/(\r?\n|\r\n?)/, "\n ") + "\n"
@content = "<blockquote style='word-break: break-all;word-wrap: break-word;'>" << @content << "</blockquote>"
@content = "<blockquote style='padding-left:0px;margin-left:0px;'>" << @content << "</blockquote>\n\n<br/>"
@id = user.id
rescue ActiveRecord::RecordNotFound
render_404

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -223,6 +223,7 @@
});
}
<% if @course %>
var tagNameHtml; //当前双击的链接的父节点的html
var tagName; //标签的值
var parentCssBorder; //当前双击的链接的父节点
@ -271,6 +272,7 @@
}
}
});
<%end %>
</script>

View File

@ -3,4 +3,4 @@
<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' if User.current.allowed_to?(:add_issues, @project) %>
<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %>
<%= link_to l(:button_edit), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %>
<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %>
<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %>

View File

@ -1,3 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %>
@ -19,7 +20,7 @@
</div>
<input name="issue_quote_new" type="hidden" value="<%= %>" />
<fieldset><legend>回复</legend>
<%= f.text_area :notes, :style => "width:99%;", :rows => "5", :no_label => true %>
<%= f.kindeditor :notes, :style => "width:99%;",:height=>'100px', :cssData =>"blockquote { padding:0px}", :rows => "5", :no_label => true, :editor_id=>'issue_journal_kind_reply' %>
</fieldset>
<!--<%# if @issue.safe_attribute? 'private_notes' %>-->
<!--<label for="issue_private_notes"><%#= f.check_box :private_notes, :no_label => true %> <%#= l(:field_private_notes) %></label>-->

View File

@ -12,9 +12,9 @@
<p>
<% if journal.details.any? %>
<% details_to_strings(journal.details).each do |string| %>
<p><%= string %></p>
<p><%= string.html_safe %></p>
<% end %>
<% end %>
<% end %>
</p>
</div>
<!--编辑、引用、回复按钮-->

View File

@ -64,7 +64,7 @@
</div>
<p style="padding-top: 5px"></p>
<%#--引用时不能修改,剥离出引用内容--%>
<a remote="true" href="javascript:void(0)" class="blue_btn fr mr80" onclick="issue_desc_editor.sync();$('#issue-form').submit();">
<a remote="true" href="javascript:void(0)" class="blue_btn fr mr80" onclick="issue_desc_editor.sync();issue_journal_kind_reply.sync();$('#issue-form').submit();">
<%= l(:button_submit) %>
</a>
<% end %>

View File

@ -1,4 +1,4 @@
$('#issue_notes').val("<%= raw escape_javascript(@content) %>");
issue_journal_kind_reply.html("<%= raw escape_javascript(@content) %>");
<%
# when quoting a private journal, check the private checkbox
if @journal && @journal.private_notes?

View File

@ -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>

View File

@ -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>

View File

@ -34,7 +34,7 @@
:id => act.id},
:class => "problem_tit fl fb " %>
</a><br />
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
<p class="mt5 break_word"><%= act.description.html_safe %><br />
<%= l :label_activity_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>
</p>
</div>
@ -51,7 +51,7 @@
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"}, :class => "problem_tit fl fb" %>
</a><br />
<p class="mt5 break_word"><%= textilizable act,:notes %><br />
<p class="mt5 break_word"><%= act.notes.html_safe %><br />
<%= l :label_activity_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
</div>
<div class="cl"></div>

View File

@ -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'%>">

View File

@ -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? %>

View File

@ -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

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

View File

@ -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,

View File

@ -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;
}

View File

@ -370,7 +370,9 @@ $(document).ready(function () {
}
function quote_issue_journal(){
document.getElementById("#issue_notes").focus();
alert("test");
issue_journal_kind_reply.focus();
issue_journal_kind_reply.cmd.range.setStart(issue_journal_kind_reply.cmd.range.startOffset)
}
/*缺陷完成度决定缺陷状态*/

View File

@ -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

View File

@ -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;}