diff --git a/app/models/memo.rb b/app/models/memo.rb index 33b24db50..7c4fbdcf1 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -9,7 +9,7 @@ class Memo < ActiveRecord::Base # 若是主题帖,则内容可以是空 #validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? } validates_length_of :subject, maximum: 50 - validates_length_of :content, maximum: 5000 + validates_length_of :content, maximum: 30000 validate :cannot_reply_to_locked_topic, :on => :create acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC" diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index fadf5e465..b316aa406 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -128,6 +128,11 @@ }); $mail.blur(function (event) { + if (/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){ + $('#mail_req').html( '邮件格式不对').show(); + $mail_correct = false; + return ; + } if ($(this).is('#user_mail')) { $.get('<%=account_valid_ajax_path%>', { valid: "mail", diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 3dbc8d8ba..ab8b80dcb 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -62,6 +62,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index b66632c7f..ef5385647 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -60,7 +60,9 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all) + :delete_all_files => l(:text_are_you_sure_all), + :lebel_file_uploding => l(:lebel_file_uploding), + :containerid => "#{container.id}" } %> <% if container.nil? %> <%= l(:label_no_file_uploaded)%> diff --git a/app/views/attachments/_form_project.html.erb b/app/views/attachments/_form_project.html.erb index d1cdf8cc9..a9cb068ad 100644 --- a/app/views/attachments/_form_project.html.erb +++ b/app/views/attachments/_form_project.html.erb @@ -60,7 +60,9 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all), + :lebel_file_uploding => l(:lebel_file_uploding), :containerid => "#{container.id}" } %> <%= l(:label_no_file_uploaded)%> diff --git a/app/views/attachments/_new_form.html.erb b/app/views/attachments/_new_form.html.erb index 47f6fd202..75efb448e 100644 --- a/app/views/attachments/_new_form.html.erb +++ b/app/views/attachments/_new_form.html.erb @@ -42,6 +42,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/blog_comments/_blog_attachments.erb b/app/views/blog_comments/_blog_attachments.erb index 48fe91099..dd8be659b 100644 --- a/app/views/blog_comments/_blog_attachments.erb +++ b/app/views/blog_comments/_blog_attachments.erb @@ -62,6 +62,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index 2d4754a0a..54c9541f2 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -164,7 +164,7 @@
<%= form_for :blog_comment, :url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> <%= render :partial => 'blog_comments/reply_form', :locals => {:f => f,:user=>@user,:article=>@article} %> - <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'canel_message_replay();', :class => " grey_btn fr c_white mt10 mr5" %> + <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-right: 5px;" %> <% end %>
diff --git a/app/views/courses/_term_select.html.erb b/app/views/courses/_term_select.html.erb new file mode 100644 index 000000000..e295e7c94 --- /dev/null +++ b/app/views/courses/_term_select.html.erb @@ -0,0 +1,41 @@ +
+
+

+ 当前课程的学期信息不能修改。如果您希望为本课程新建学期,请根据需要执行以下两种操作之一(目前复制学期正在改进中,将尽快上线)。选择前请参考按钮右侧的说明: +

+
+
+ + 新建学期 + + 新建学期将为您创建一个新的课程学期,新学期不包括之前学期的任何内容。 +
+
+
+ +
+ 复制学期 + (开发中...) +
+ 复制学期将为您创建一个新的课程学期,新学期将继承本学期的相关资源,具体您稍后可以选择。 +
+
+ +
+
+ + \ No newline at end of file diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index a462db79d..a90be14ea 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -36,8 +36,8 @@
  • - <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %> - <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %> + <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"time_selected"} %> + <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"term_selected"} %>
  • @@ -92,4 +92,17 @@
  • -
    \ No newline at end of file +
    + \ No newline at end of file diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index 01e5dca5f..c5a3b9af0 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -17,6 +17,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> <% else %> @@ -35,6 +36,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> <% end %> diff --git a/app/views/files/_new_style_attachment_list.html.erb b/app/views/files/_new_style_attachment_list.html.erb index 022486413..174a05047 100644 --- a/app/views/files/_new_style_attachment_list.html.erb +++ b/app/views/files/_new_style_attachment_list.html.erb @@ -1,71 +1,35 @@ + <% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%> - -<% if @course %> - <%= file_field_tag 'attachments[dummy][file]', - :id => '_file', - :class => ie8? ? '':'file_selector', - :multiple => true, - :onchange => 'addInputFilesCourseSource(this,"'+ checkBox.to_s+'");', - :style => ie8? ? '': 'display:none', - :data => { - :max_file_size => Setting.attachment_max_size.to_i.kilobytes, - :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js'), - :description_placeholder => l(:label_optional_description), - :field_is_public => l(:field_is_public), - :are_you_sure => l(:text_are_you_sure), - :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all) - } %> -<% else %> - <%= file_field_tag 'attachments[dummy][file]', - :id => '_file', - :class => ie8? ? '':'file_selector', - :multiple => true, - :onchange => 'addInputFiles(this);', - :style => ie8? ? '': 'display:none', - :data => { - :max_file_size => Setting.attachment_max_size.to_i.kilobytes, - :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js'), - :description_placeholder => l(:label_optional_description), - :field_is_public => l(:field_is_public), - :are_you_sure => l(:text_are_you_sure), - :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all) - } %> -<% end %> - + + <%= file_field_tag 'attachments[dummy][file]', + :id => "_file#{container.id}", + :class => ie8? ? '':'file_selector', + :multiple => true, + :onchange => "addInputFiles_board(this, '#{container.id}');", + :style => ie8? ? '': 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js'), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all), + :lebel_file_uploding => l(:lebel_file_uploding), + :containerid => "#{container.id}" + } %> + - + <%= l(:label_no_file_uploaded)%> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
    - -<% if defined?(container) && container && container.saved_attachments %> - <% container.attachments.each_with_index do |attachment, i| %> - - <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> - <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> - <%= l(:field_is_public)%>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> - <%= if attachment.id.nil? - #待补充代码 - else - link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') - end - %> - <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> - - <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> - - <% end %> -<% end %> +
    \ No newline at end of file diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index 3578d4eb9..9c7021383 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -19,7 +19,7 @@
    - <%= render :partial => 'files/new_style_attachment_list',:locals => {:course => course} %> + <%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
    <%= l(:button_cancel)%> diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb index 560afc6d9..2510952f1 100644 --- a/app/views/forums/_file_form.html.erb +++ b/app/views/forums/_file_form.html.erb @@ -63,6 +63,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 25a4fae46..05c086ed4 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -1,4 +1,56 @@ <%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor' %> + +
    + + +
    + <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%> +
    +
      + <%= pagination_links_full @topic_pages, @topic_count ,:per_page_links => true, :remote => true, :flag => true %> +
    + + + + + + + + + + + +
    + -
    - - -
    - <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%> -
    -
      - <%= pagination_links_full @topic_pages, @topic_count ,:per_page_links => true, :remote => true, :flag => true %> -
    - - - - - - - - - - - -
    - \ No newline at end of file + \ No newline at end of file diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index e06db1d0f..d2186118d 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -226,7 +226,7 @@ function project_files_upload() { - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_show_project',:locals => {:project => @project}) %>'); + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/upload_project_files_on_navbar',:locals => {:container => @project}) %>'); showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index d26ebdbf8..cace5bcc8 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -7,10 +7,11 @@ $("#error").html('主题不能超过50个字符').show(); return; } -// if(memo_content.html().trim().length > 5000 ){ -// $("#error").html('内容不能超过5000个字符').show(); -// return; -// } + if(memo_content.html().length > 20000){ + $("#error").html("内容 过长(最长为 20000 个字符)").show(); + $("html,body").animate({scrollTop:$("#error").offset().top},1000) + return false; + } memo_content.sync(); $("#edit_memo").submit(); }else if($("textarea[name='memo[subject]']").val().trim() == "" && !memo_content.isEmpty() ){ diff --git a/app/views/projects/_upload_project_files_list.html.erb b/app/views/projects/_upload_project_files_list.html.erb new file mode 100644 index 000000000..c399bf210 --- /dev/null +++ b/app/views/projects/_upload_project_files_list.html.erb @@ -0,0 +1,37 @@ + +<% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%> + + <%= file_field_tag 'attachments[dummy][file]', + :id => "_file#{container.id}", + :class => ie8? ? '':'file_selector', + :multiple => true, + :onchange => "addInputFiles_board(this, '#{container.id}');", + :style => ie8? ? '': 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js'), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), + :delete_all_files => l(:text_are_you_sure_all), + :containerid => "#{container.id}" + } %> + + + + + <%= l(:label_no_file_uploaded)%> + +(<%= l(:label_max_size) %>: +<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) +
    + +
    + + +
    +
    \ No newline at end of file diff --git a/app/views/projects/_upload_project_files_on_navbar.html.erb b/app/views/projects/_upload_project_files_on_navbar.html.erb new file mode 100644 index 000000000..591e159f1 --- /dev/null +++ b/app/views/projects/_upload_project_files_on_navbar.html.erb @@ -0,0 +1,30 @@ + +
    +
    +

    <%= l(:label_upload_files)%>

    +
    + <%= error_messages_for 'attachment' %> + + + <%= form_tag(project_files_path(container), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> + + + <%= render :partial => 'projects/upload_project_files_list',:locals => {:container => container} %> +
    + <%= l(:button_cancel)%> + <%= l(:button_confirm)%> + <% end %> +
    + +
    + <% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> + <% end %> +
    + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 0d55cb130..ebe3d4cc6 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -80,6 +80,6 @@ <% end%> -
  • 点击查看详情
  • + diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index aa6009466..81d868a50 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -48,7 +48,7 @@
  • <%= 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(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> [迟交] <% end %>
  • @@ -58,6 +58,6 @@
  • <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
  • -
  • 点击查看详情
  • + diff --git a/app/views/student_work/_student_work_attachment_form.html.erb b/app/views/student_work/_student_work_attachment_form.html.erb index 265ff9be7..d82aea7f9 100644 --- a/app/views/student_work/_student_work_attachment_form.html.erb +++ b/app/views/student_work/_student_work_attachment_form.html.erb @@ -19,6 +19,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all), :containerid => "#{work.id}" } %> diff --git a/app/views/users/_attachment_list.html.erb b/app/views/users/_attachment_list.html.erb index 33e944498..3d44fa267 100644 --- a/app/views/users/_attachment_list.html.erb +++ b/app/views/users/_attachment_list.html.erb @@ -18,6 +18,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index 34d609487..6f47e3535 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -21,5 +21,7 @@
  • <%= format_date(attach.created_on) %>
  • <%= attach.id %>
  • +
      + <% end %> <% end %> diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 9b7c6c06a..24d37ae63 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -40,6 +40,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index 41c7c1eee..da649663d 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -66,9 +66,10 @@
    • 课程名称:<%= ma.course_message.course.name %> (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
    • 作业标题:<%= ma.course_message.name %>
    • -
    • 提交截止:<%= ma.course_message.end_time %>  23:59
    • -
    • 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %>  23:59
    • -
    • 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %>  23:59
    • +
    • 发布时间:<%= DateTime.parse(ma.course_message.created_at.to_s).strftime('%Y-%m-%d %H:%M').to_s %>
    • +
    • 提交截止:<%= ma.course_message.end_time %> 23:59
    • +
    • 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 23:59
    • +
    • 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 23:59
    • 迟交扣分:<%= ma.course_message.late_penalty %>分
    • 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
    • @@ -380,7 +381,7 @@