diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index d5c248f77..5d83c1320 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -175,19 +175,19 @@ class NewsController < ApplicationController update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS end # ������ض�̬�ļ�¼add start - teachers = searchTeacherAndAssistant(@course) - for teacher in teachers - if(teacher.user_id != User.current.id) - notify = ActivityNotify.new() - notify.activity_container_id = @course.id - notify.activity_container_type = 'Course' - notify.activity_id = @news.id - notify.activity_type = 'News' - notify.notify_to = teacher.user_id - notify.is_read = 0 - notify.save() - end - end + # teachers = searchTeacherAndAssistant(@course) + # for teacher in teachers + # if(teacher.user_id != User.current.id) + # notify = ActivityNotify.new() + # notify.activity_container_id = @course.id + # notify.activity_container_type = 'Course' + # notify.activity_id = @news.id + # notify.activity_type = 'News' + # notify.notify_to = teacher.user_id + # notify.is_read = 0 + # notify.save() + # end + # end # ������ض�̬�ļ�¼add end render_attachment_warning_if_needed(@news) flash[:notice] = l(:notice_successful_create) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index f2858d097..17f179492 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -271,6 +271,7 @@ class StudentWorkController < ApplicationController end @is_new = false else + @is_last_a = @work.student_works_scores.empty? @score = StudentWorksScore.new @score.score = params[:score] if params[:score] @score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4f3df3bd4..73a26b52c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -358,6 +358,7 @@ class UsersController < ApplicationController #导入作业 def user_import_homeworks + @select_course = params[:select_course] ? 1 : 0 @user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc") respond_to do |format| format.js @@ -377,6 +378,7 @@ class UsersController < ApplicationController homework = HomeworkCommon.find_by_id params[:checkMenu] homework_detail_programing = homework.homework_detail_programing @homework = HomeworkCommon.new + @select_course = params[:select_course] || 0 if homework @homework.name = homework.name @homework.description = homework.description diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 6c4aca02d..39e709beb 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -59,7 +59,6 @@ class Mailer < ActionMailer::Base @anonymous_comment_close_name = homework_common.name @author = homework_common.user #收件人邮箱 - recipients << user.mail end mail :to => recipients, @@ -98,10 +97,6 @@ class Mailer < ActionMailer::Base @anonymous_comment_fail_name = homework_common.name @author = homework_common.user #收件人邮箱 - puts "######################" - puts homework_common.id - puts recipients - puts "######################" recipients << user.mail end end diff --git a/app/models/memo.rb b/app/models/memo.rb index c30616558..33b24db50 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -79,7 +79,7 @@ class Memo < ActiveRecord::Base receivers << self.forum.creator end # 添加发帖人 - if self.author_id != self.parent.author_id + if self.author_id != self.parent.author_id && self.parent.author_id != self.forum.creator_id receivers << self.parent.author end end diff --git a/app/views/avatar/_new_avatar_form.html.erb b/app/views/avatar/_new_avatar_form.html.erb index de3bf2b65..2593bf1f5 100644 --- a/app/views/avatar/_new_avatar_form.html.erb +++ b/app/views/avatar/_new_avatar_form.html.erb @@ -1,10 +1,11 @@ <%= image_tag(url_to_avatar(source), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%> -<%= l(:button_upload_photo) %> +<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "upbtn fl" %> +<%= l(:button_upload_photo) %> <%= file_field_tag 'avatar[image]', - :id => "upload_img", - :class => 'undis', + :id => 'upload_course_logo', + :class => 'undis upload_file', :size => "1", :multiple => true, :data => { diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index bb8bb546a..78f44aa31 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -17,9 +17,9 @@
  • <%= link_to "全部动态", {:controller => "courses", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
  • <%= link_to "作业动态", {:controller => "courses", :action => "show", :type => "homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
  • <%= link_to "通知动态", {:controller => "courses", :action => "show", :type => "news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
  • -
  • <%= link_to "资源库动态", {:controller => "courses", :action => "show", :type => "attachment"}, :class => "resourcesTypeAtt resourcesGrey"%>
  • +
  • <%= link_to "资源库动态", {:controller => "courses", :action => "show", :type => "attachment"}, :class => "homepagePostTypeResource resourcesGrey"%>
  • <%= link_to "论坛动态", {:controller => "courses", :action => "show", :type => "message"}, :class => "homepagePostTypeForum postTypeGrey"%>
  • -
  • <%= link_to "留言动态", {:controller => "courses", :action => "show", :type => "journalsForMessage"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
  • +
  • <%= link_to "留言动态", {:controller => "courses", :action => "show", :type => "journalsForMessage"}, :class => "homepagePostTypeMessage postTypeGrey"%>
  • <%= link_to "问卷动态", {:controller => "courses", :action => "show", :type => "poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
  • diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index f5e22002a..6d3ebdf68 100644 --- a/app/views/files/_tag_yun.html.erb +++ b/app/views/files/_tag_yun.html.erb @@ -1,9 +1,12 @@ <% unless tag_list.nil?%> <% tag_list.each do |k,v|%> <% if tag_name && tag_name == k%> - <%= k%>×<%= v%> + <%= k%>×<%= v%> <% else%> - <%= k%>×<%= v%> + + <%= k%>×<%= v%> <% end%> <% end%> <% end%> \ No newline at end of file diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 34f7452a7..3825a9b09 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -234,6 +234,8 @@ //第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。 //目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id,就是第一种情况。如果没有id。就是第二种情况 function rename_tag(domEle,name,id,type){ + isdb = true; //这是双击 + //clearTimeout(clickFunction); if(domEle.children().get(0) != undefined ){ //已经是编辑框的情况下不要动 return; } @@ -250,6 +252,7 @@ } //监听所有的单击事件 $(document.body).click(function(e){ + isdb = false; //这是单击 node = document.elementFromPoint(e.clientX, e.clientY); if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了 return; @@ -260,15 +263,15 @@ ele.parent().html(tagNameHtml); }else{ //否则就要更新tag名称了 - if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){ +// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){ 去掉询问 $.post( '<%= update_tag_name_path %>', {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>} ) - }else{ - ele.parent().css("border",""); - ele.parent().html(tagNameHtml); - } +// }else{ +// ele.parent().css("border",""); +// ele.parent().html(tagNameHtml); +// } } } }); diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 0eb779a23..76e178120 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -28,7 +28,7 @@ 'action_menu' %>
    <% if @issue.description? || @issue.attachments.any? -%> -
    +
    <% if @issue.description? %> <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 941f8b8e3..d0cbc1f6b 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -94,11 +94,13 @@
    +
    diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index 134dedb54..8677bc705 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -123,7 +123,7 @@ } }); - function del_confirm(){ + function del_forum_confirm(){ if(confirm('您确定要删除么?')){ $("#del_link").click(); } @@ -158,11 +158,11 @@
    <%= @forum.description.html_safe%> - <%#if @forum.creator.id == User.current.id%> - - <%#= image_tag('signature_edit.png',{:width=>12,:height=>12})%> - - <%#end%> + <%if @forum.creator.id == User.current.id%> + + <%= image_tag('signature_edit.png',{:width=>12,:height=>12})%> + + <%end%>
    @@ -180,7 +180,7 @@ 编辑贴吧 - 删除贴吧 + 删除贴吧 <% end %> diff --git a/app/views/memos/_praise_tread.html.erb b/app/views/memos/_praise_tread.html.erb index 5850cf50a..258a265a2 100644 --- a/app/views/memos/_praise_tread.html.erb +++ b/app/views/memos/_praise_tread.html.erb @@ -7,7 +7,7 @@ <% if @is_valuate.size > 0 %> <% @flag = @is_valuate.first.praise_or_tread %> <% if @flag == 1 %> - <%= get_praise_num(obj)%> + <%= get_praise_num(obj)%> <% end %> <% else %> <% if user_id == obj.author_id %> diff --git a/app/views/projects/destroy.html.erb b/app/views/projects/destroy.html.erb index 49d5babf7..f99e5581c 100644 --- a/app/views/projects/destroy.html.erb +++ b/app/views/projects/destroy.html.erb @@ -1,17 +1,19 @@ -

    <%=l(:label_confirmation)%>

    +
    +

    <%=l(:label_confirmation)%>

    +
    -

    <%=h @project_to_destroy %>
    -<%=l(:text_project_destroy_confirmation)%> +

    <%=h @project_to_destroy %>

    + <%=l(:text_project_destroy_confirmation)%> -<% if @project_to_destroy.descendants.any? %> -
    <%= l(:text_subprojects_destroy_warning, - content_tag('strong', h(@project_to_destroy.descendants.collect{|p| p.to_s}.join(', ')))).html_safe %> -<% end %> -

    -

    + <% if @project_to_destroy.descendants.any? %> +
    <%= l(:text_subprojects_destroy_warning, + content_tag('strong', h(@project_to_destroy.descendants.collect{|p| p.to_s}.join(', ')))).html_safe %> + <% end %> +

    +

    <%= form_tag(project_path(@project_to_destroy), :method => :delete) do %> - - <%= submit_tag l(:button_delete) %> + + <%= submit_tag l(:button_delete) %> <% end %> -

    +

    diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index da2723636..94fcfcee2 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -26,9 +26,11 @@
  • - <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  - <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> - [迟交] + <% if student_work.created_at && @homework.end_time%> + <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> + [迟交] + <% end %> <% end %>
  • diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index 6cb5bd6d8..762aa4a8a 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -2,8 +2,7 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti $('#score_<%= @work.id%>').peSlider({range: 'min'}); <% if @is_new%> - $("#score_list_<%= @work.id%>").find("div:last").find("ul").addClass("ping_line"); - $("#score_list_<%= @work.id%>").prepend("
    <%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => true}) %>
    "); + $("#score_list_<%= @work.id%>").prepend("
    <%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last_a}) %>
    "); <% else %> $("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last}) %>"); <% end%> diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb index 1fcd3797e..aab26c20b 100644 --- a/app/views/users/_course_journalsformessage.html.erb +++ b/app/views/users/_course_journalsformessage.html.erb @@ -14,10 +14,10 @@ <%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
  • - <% if activity.m_parent_id.nil? %> - <%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> + <% if activity.parent %> + <%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> <% else %> - <%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> + <%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> <% end %>
    diff --git a/app/views/users/_show_user_homeworks.html.erb b/app/views/users/_show_user_homeworks.html.erb index c14278de3..935cc4513 100644 --- a/app/views/users/_show_user_homeworks.html.erb +++ b/app/views/users/_show_user_homeworks.html.erb @@ -10,6 +10,7 @@ <% end%>
    <%= form_tag(user_select_homework_users_path, :multipart => true,:remote => true,:name=>"select_homework_form",:id=>'select_homework_form') do %> +
    <%= render :partial => 'users/show_user_homework_form', :locals => {:user_homeworks => @user_homeworks}%>
    diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index fe320992a..6167e4e10 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -16,7 +16,7 @@
    - <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%> + <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%>
    <%= calendar_for('homework_end_time')%> diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb index c8998fd55..c3a736058 100644 --- a/app/views/users/new_user_commit_homework.html.erb +++ b/app/views/users/new_user_commit_homework.html.erb @@ -105,7 +105,10 @@ <% @student_work.student_work_tests.each_with_index do |test, index| %>
    -

    第<%= @student_work.student_work_tests.count - index%>次测试

    <%= test.created_at.to_s(:db) %> +

    + 第<%= @student_work.student_work_tests.count - index%>次测试 +

    + <%= format_time(test.created_at).to_s%>
    <% if test.status.to_i == -2 %> diff --git a/app/views/users/user_select_homework.js.erb b/app/views/users/user_select_homework.js.erb index 308f74938..1d9cc8d70 100644 --- a/app/views/users/user_select_homework.js.erb +++ b/app/views/users/user_select_homework.js.erb @@ -2,7 +2,9 @@ hideModal('#coursesChoosePopup'); $("#homework_name").val("<%= @homework.name%>"); $("#homework_end_time").val("<%= @homework.end_time%>"); -$("#course_id").val("<%= @homework.course_id%>"); +<% if @select_course == "0"%> + $("#course_id").val("<%= @homework.course_id%>"); +<% end%> $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true })%>"); homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>"); $("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>"); diff --git a/db/migrate/20150930011457_alter_user_activities_news.rb b/db/migrate/20150930011457_alter_user_activities_news.rb new file mode 100644 index 000000000..f91cbb791 --- /dev/null +++ b/db/migrate/20150930011457_alter_user_activities_news.rb @@ -0,0 +1,18 @@ +class AlterUserActivitiesNews < ActiveRecord::Migration + def up + UserActivity.all.each do |activity| + if activity.act_type == 'News' + if activity.act + activity.created_at = activity.act.created_on + activity.updated_at = activity.act.respond_to?("updated_on") ? activity.act.updated_on : activity.act.created_on + activity.save + else + activity.destroy + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 205f3140c..abc7017e6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150928090128) do +ActiveRecord::Schema.define(:version => 20150917022239) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -575,8 +575,6 @@ ActiveRecord::Schema.define(:version => 20150928090128) do t.integer "viewed" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "secret_key" - t.integer "status" end create_table "forums", :force => true do |t| @@ -785,6 +783,16 @@ ActiveRecord::Schema.define(:version => 20150928090128) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_details_copy", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" @@ -903,7 +911,6 @@ ActiveRecord::Schema.define(:version => 20150928090128) do t.datetime "updated_on", :null => false t.boolean "locked", :default => false t.integer "sticky", :default => 0 - t.integer "reply_id" end add_index "messages", ["author_id"], :name => "index_messages_on_author_id" @@ -1369,7 +1376,6 @@ ActiveRecord::Schema.define(:version => 20150928090128) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.text "description" - t.string "subject" end create_table "taggings", :force => true do |t| diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 645767e87..448585376 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -5031,7 +5031,7 @@ KEditor.prototype = { height : editHeight > 0 && _removeUnit(height) > self.minHeight ? editHeight : self.minHeight, src : editDiv, srcElement : self.srcElement, - designMode : self.designMode, + designMode : true, themesPath : self.themesPath, bodyClass : self.bodyClass, cssPath : self.cssPath, @@ -5063,9 +5063,9 @@ KEditor.prototype = { _bindTabEvent.call(self); _bindFocusEvent.call(self); edit.afterChange(function(e) { - if (!edit.designMode) { - return; - } +// if (!edit.designMode) { +// return; +// } self.updateState(); self.addBookmark(); //prettyPrint("",self.edit.doc.body); diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index 5cb46628b..5fcdebe92 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -33,8 +33,8 @@ } .ke-content p { - margin: 0 0 15px 0; - margin-bottom:15pt; + /*margin: 0 0 15px 0;*/ + /*margin-bottom:15pt;*/ line-height:1.5; letter-spacing: 1px; } diff --git a/public/assets/kindeditor/plugins/emoticons/emoticons.js b/public/assets/kindeditor/plugins/emoticons/emoticons.js index c89e0c6ee..b9dfec431 100644 --- a/public/assets/kindeditor/plugins/emoticons/emoticons.js +++ b/public/assets/kindeditor/plugins/emoticons/emoticons.js @@ -13,7 +13,7 @@ KindEditor.plugin('emoticons', function(K) { allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons, currentPageNum = 1; self.clickToolbar(name, function() { - this.edit.focus();//û ȡ _getSel()Ϊ + this.edit.focus();//���û����� �����ȡ�������� ����_getSel()Ϊ�� ���� var rows = 5, cols = 9, total = 135, startNum = 0, cells = rows * cols, pages = Math.ceil(total / cells), colsHalf = Math.floor(cols / 2), @@ -55,6 +55,9 @@ KindEditor.plugin('emoticons', function(K) { K(this).removeClass('ke-on'); }); cell.click(function(e) { + if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(self.edit.html())){ + self.edit.html(''); + } self.insertHtml('').hideMenu().focus(); e.stop(); }); diff --git a/public/images/homepage_icon.png b/public/images/homepage_icon.png index 28a7eb44a..a8548b1bc 100644 Binary files a/public/images/homepage_icon.png and b/public/images/homepage_icon.png differ diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 46a98ed6d..6102801df 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -410,22 +410,6 @@ function show_bid_dead_line(year,month,day,divname) + "

    作品提交还剩:

    "); } -//验证新建作业的名字 -function regex_homework_name() -{ - var name = $.trim($("#homework_name").val()); - - if(name=="") - { - $("#homework_name_span").text("名称不能为空"); - return false; - } - else - { - $("#homework_name_span").text(""); - return true; - } -} //处理迟交、缺评扣分 function check_late_penalty(id) @@ -579,22 +563,68 @@ function regex_evaluation_num(){ } //老师提交 新建/修改 作业 -//function submit_homework(id) -//{ -// if(!regex_homework_name()) -// { -// $("#homework_name").focus(); -// } -// else if(!regex_evaluation_num()) -// { -// $("#evaluation_num").focus(); -// } -// else -// { -// homework_description_editor.sync(); -// $("#"+id).submit(); -// } -//} +function submit_homework(id){ + if(!regex_homework_name()){ + $("#homework_name").focus(); + } + else if(!regex_homework_end_time()){ + $("#homework_end_time").focus(); + } + else if(!regex_course_id()){ + $("#course_id").focus(); + } + else{ + homework_description_editor.sync(); + $("#"+id).submit(); + } +} + +//验证新建作业的名字 +function regex_homework_name() +{ + var name = $.trim($("#homework_name").val()); + + if(name=="") + { + $("#homework_name_span").text("名称不能为空"); + return false; + } + else + { + $("#homework_name_span").text(""); + return true; + } +} +//验证截止时间 +function regex_homework_end_time() +{ + var name = $.trim($("#homework_end_time").val()); + if(name=="") + { + $("#homework_end_time_span").text("截止时间不能为空"); + return false; + } + else + { + $("#homework_end_time_span").text(""); + return true; + } +} + +//验证发送到课程 +function regex_course_id(){ + var course_id = $("#course_id").val(); + if(course_id == -1) + { + $("#homework_course_id_span").text("发布课程不能为空"); + return false; + } + else + { + $("#homework_course_id_span").text(""); + return true; + } +} function regexHomeworkCommonName() { @@ -714,20 +744,30 @@ $(function(){ }); //查找TAG资源 +var clickFunction = null; //单击事件函数 +var isdb = false; //是否双击 function search_tag_attachment(url,tag_name,q,course_id,sort) { //alert("111"); - $.get( - url, - { - tag_name: tag_name, - q: q, - course_id:course_id - }, - function (data) { + //clearTimeout(clickFunction); + clickFunction = setTimeout(function() { + search_func() + }, 200); + function search_func(){ + if(isdb!= false ) return; + $.get( + url, + { + tag_name: tag_name, + q: q, + course_id:course_id + }, + function (data) { + + } + ); + } - } - ); } // 课程讨论区 diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 28fa9597f..be3119257 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -63,17 +63,10 @@ function submit_homework(id){ else if(!regex_homework_end_time()){ $("#homework_end_time").focus(); } - //else if(!regex_evaluation_start()){ - // $("#evaluation_start_time").focus() - //} - //else if(!regex_evaluation_end()){ - // $("#evaluation_end_time").focus() - //} else if(!regex_course_id()){ $("#course_id").focus(); } else{ - homework_description_editor.sync(); $("#"+id).submit(); } diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 8661626c8..c6e9b27d3 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -96,6 +96,8 @@ a.homepagePostTypeAssignment {background:url(../images/homepage_icon.png) -93px a.homepagePostTypeNotice {background:url(../images/homepage_icon.png) -87px -280px no-repeat; padding-left:23px;} a.homepagePostTypeForum {background:url(../images/homepage_icon.png) -10px -310px no-repeat; padding-left:23px;} a.homepagePostTypeQuiz {background:url(../images/homepage_icon.png) -90px -124px no-repeat; padding-left:23px;} +a.homepagePostTypeMessage {background:url(images/homepage_icon.png) -3px -518px no-repeat; padding-left:23px;} +a.homepagePostTypeResource {background:url(images/homepage_icon.png) -86px -517px no-repeat; padding-left:23px;} a.homepagePostTypeQuestion {background:url(../images/homepage_icon.png) -10px -273px no-repeat; padding-left:23px;} a.homepagePostTypeMine {background:url(../images/homepage_icon.png) -187px -277px no-repeat; padding-left:23px;} a.homepagePostTypeAll {background:url(../images/homepage_icon.png) -189px -308px no-repeat; padding-left:23px;} @@ -312,7 +314,7 @@ a.un_work_edit{color: white; display:block; padding:1px 5px; background-color: d .normaltab a { color:#64bdd9 ; } .hovertab a{color:#fff; background-color:#64bdd9; text-decoration:none;} .dis{display:block; } -.undis{display:none;} + .c_red{ color:#de030d;} input.c_red {padding:0px; text-align:center; border:0;} .f_12{ font-size:12px;} @@ -510,9 +512,7 @@ a:hover.st_add{ color:#ff8e15;} .courses_text{ border:1px solid #64bdd9; height:100px;width:532px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;} .upimg{ border:1px solid #eaeaea; display:block; width:60px; height:60px; padding:1px;} .upimg:hover{ border:1px solid #64bdd9; } -.upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;} -.upbtn:hover{color:#64bdd9;cursor: pointer;} -.upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer} + /* 功能倒计时*/ .w_img{ float:left; margin:10px 10px 15px 0px;} .w_p{ float:left; color:#15bccf; font-size:16px; font-weight:bold; margin-top:70px; } @@ -723,7 +723,7 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px /*padding:1px 10px 修改原因,padding会导致内部输入框和外边框有边距*/ a.files_tag_icon{ width:auto;background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 5px; float:left; margin-right:10px;margin-bottom:10px; } span.files_tag_icon{ width:auto;background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 5px; float:left; margin-right:10px;margin-bottom:10px; } -a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;} +a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #bbe2ef; padding:1px 1px; float:left; margin-right:10px;margin-bottom:10px;}/* padding:1px 10px;*/ /* 20150423作业评分*/ .ml14{ margin-left:14px;} @@ -873,7 +873,7 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f .filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .evaluation{position: relative;} -.evaluation_submit{position: absolute;right: 0px;bottom: 5px;} +.evaluation_submit{position: absolute;right: 0px;bottom: 0px;} .student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; } /* 与我相关 */ diff --git a/public/stylesheets/header.css b/public/stylesheets/header.css index 25c2ae211..b6566d628 100644 --- a/public/stylesheets/header.css +++ b/public/stylesheets/header.css @@ -14,7 +14,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no- #navSearchAlert {display:none;} .navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;} .homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;} -.newsActive {width:10px; height:10px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;} +.newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 2px;padding-right: 1px;font-weight: bold;} .navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;} .homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;} .homepageProfileMenuIconhover {background:url(../images/nav_icon.png) 30px -122px no-repeat;} diff --git a/public/stylesheets/images/homepage_icon.png b/public/stylesheets/images/homepage_icon.png index 28a7eb44a..4bd18bf8f 100644 Binary files a/public/stylesheets/images/homepage_icon.png and b/public/stylesheets/images/homepage_icon.png differ diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index ace5cb651..8de891699 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -528,7 +528,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no- #navSearchAlert {display:none;} .navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;} .homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;} -.newsActive {width:10px; height:10px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;} +.newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 2px;padding-right: 1px;font-weight: bold;} .navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;} .portraitRadius {border-radius: 3px;} .homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;} @@ -741,9 +741,9 @@ ul.list_watch{ .referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;} .referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;} -.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -270px no-repeat; display:inline-block; float:left;} -.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -180px -311px no-repeat;} -.referenceResourceType {font-size:14px; width:475px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} +.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon2.png) -180px -270px no-repeat; display:inline-block; float:left;} +.referenceSearchIcon:hover {background:url(../images/homepage_icon2.png) -180px -311px no-repeat;} +.referenceResourceType {font-size:14px; width:460px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} .referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} @@ -798,6 +798,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailWrap {width:580px; float:left;} .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} +.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailReply { margin-top:28px; color:#888888; float:right;} diff --git a/public/stylesheets/prettify.css b/public/stylesheets/prettify.css index 2e750f076..4ae3a5e0d 100644 --- a/public/stylesheets/prettify.css +++ b/public/stylesheets/prettify.css @@ -43,7 +43,14 @@ pre li,ul,ol { } /* Specify class=linenums on a pre to get line numbering */ -ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 15px } /* IE indents via margin-left */ +ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 15px;margin-left: 0px !important; } /* IE indents via margin-left */ +.list_style ol li { + list-style-type: decimal; + margin-left: 10px !important; +} +.linenums li { + margin-left: 0px !important; +} li.L0, li.L1, li.L2, diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 2806a1dbe..f769ff9e6 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -221,6 +221,7 @@ a:hover.talk_btn{ background:#2a9dc1;} /****讨论区内页***/ .mt0{ margin-top:0px;} .talk_info{ color:#7d7d7d; margin-left:60px; margin-top:10px;} +.issue_desc li{list-style-type: decimal;margin-left: 20px;} .talk_info img {max-width:100%;} a.talk_edit{ color:#426e9a; margin-right:5px;} a:hover.talk_edit{ color:#ff5722;} @@ -881,3 +882,19 @@ a:hover.Reply_pic{border:1px solid #64bdd9;} .wiki {width: 510px;} .wiki img {max-width:100%;} +#content_ .tabs_enterprise ul li a.selected:hover {background-color: #E2F4FF;} +/*end*/ +/*end*/ +/***** Diff *****/ +.diff_out { background: #fcc; } +.diff_out span { background: #faa; } +.diff_in { background: #cfc; } +.diff_in span { background: #afa; } + +.text-diff { + padding: 1em; + background-color:#f6f6f6; + color:#505050; + border: 1px solid #e4e4e4; +} + diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 144b8526c..eb9732754 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -269,7 +269,10 @@ a:hover.bgreen_n_btn{background:#08a384;} .nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;} .more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;} -/*.upbtn{ margin:42px 0 0 10px; border:none; color:#999; }*/ +.upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;} +.upbtn:hover{color:#64bdd9;cursor: pointer;} +.upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer} +.undis{display:none;} .red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} @@ -448,7 +451,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no- #navSearchAlert {display:none;} .navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;} .homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;} -.newsActive {width:8px; height:8px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;} +.newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 2px;padding-right: 1px;font-weight: bold;} .navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;} .homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block;} .homepageProfileMenuIcon:hover {background:url(../images/nav_icon.png) 30px -122px no-repeat;} @@ -624,9 +627,9 @@ a.loginChooseTab {color:#484848; height:30px; display:block;} .referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;} .referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;} -.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -270px no-repeat; display:inline-block; float:left;} -.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -180px -311px no-repeat;} -.referenceResourceType {font-size:14px; width:475px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} +.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon2.png) -180px -270px no-repeat; display:inline-block; float:left;} +.referenceSearchIcon:hover {background:url(../images/homepage_icon2.png) -180px -311px no-repeat;} +.referenceResourceType {font-size:14px; width:460px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} .referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}