- <%= link_to truncate(file.filename,length: 35, omission: '...'), download_named_attachment_path(file.id, file.filename, preview: true),:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
+ <%= link_to truncate(file.filename,length: 35, omission: '...'),
+ download_named_attachment_path(file.id, file.filename),
+ :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %>
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
@@ -40,7 +42,7 @@
<% else %>
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% end %>
- <%= link_to_attachment file, text: '下载', class: 'f_l re_open' %>
+ <%= file_preview_tag(file, class: 'f_l re_open') %>
<% else %>
<% end %>
diff --git a/app/views/files/_project_file_list.html.erb b/app/views/files/_project_file_list.html.erb
index 81b69d754..9f9e86cff 100644
--- a/app/views/files/_project_file_list.html.erb
+++ b/app/views/files/_project_file_list.html.erb
@@ -18,7 +18,9 @@
<% project_attachments.each do |file| %>
- <%= link_to truncate(file.filename,length: 35, omission: '...'), download_named_attachment_path(file.id, file.filename, preview: true),:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
+ <%= link_to truncate(file.filename,length: 35, omission: '...'),
+ download_named_attachment_path(file.id, file.filename),
+ :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %>
<% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
@@ -30,7 +32,7 @@
<% else %>
<%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
<% end %>
- <%= link_to_attachment file, text: '下载', class: 'f_l re_open' %>
+ <%= file_preview_tag(file, class: 'f_l re_open') %>
<% end %>
diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb
index 9fe72fdb7..0a40120c7 100644
--- a/app/views/forums/edit.html.erb
+++ b/app/views/forums/edit.html.erb
@@ -1,4 +1,4 @@
编辑讨论区
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= render 'form_edit_mode' %>
diff --git a/app/views/forums/new.html.erb b/app/views/forums/new.html.erb
index 35814d843..9bce17416 100644
--- a/app/views/forums/new.html.erb
+++ b/app/views/forums/new.html.erb
@@ -5,7 +5,7 @@
<% @nav_dispaly_forum_label = 1%>
<%= l :label_forum_new %>
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= render 'form_create_mode' %>
<%#= link_to l(:button_back), forums_path %>
diff --git a/app/views/homework_common/edit.html.erb b/app/views/homework_common/edit.html.erb
index f9d3f8b70..50feca946 100644
--- a/app/views/homework_common/edit.html.erb
+++ b/app/views/homework_common/edit.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= error_messages_for 'homework_common' %>
@@ -13,4 +13,4 @@
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
-
\ No newline at end of file
+
diff --git a/app/views/homework_common/new.html.erb b/app/views/homework_common/new.html.erb
index b0fdc5299..dc67b5079 100644
--- a/app/views/homework_common/new.html.erb
+++ b/app/views/homework_common/new.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= error_messages_for 'homework_common' %>
@@ -14,4 +14,4 @@
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
-
\ No newline at end of file
+
diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb
index 77f3baf31..26aff7d61 100644
--- a/app/views/issues/new.html.erb
+++ b/app/views/issues/new.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= l(:label_issue_new) %>
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 59ad0b1d2..1bd956074 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= l(:label_issue_edit) %>
diff --git a/app/views/journals/diff.html.erb b/app/views/journals/diff.html.erb
index d3dfa7d34..5bc823c76 100644
--- a/app/views/journals/diff.html.erb
+++ b/app/views/journals/diff.html.erb
@@ -2,7 +2,7 @@
<%= authoring @journal.created_on, @journal.user, :label => :label_updated_time_by %>
-<%= simple_format_without_paragraph @diff.to_html %>
+ <%= simple_format_without_paragraph @diff.to_html %>
<%= link_to l(:button_back), issue_path(@issue), :onclick => 'history.back(); return false;' %>
diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb
index 4d79f50f9..eae133184 100644
--- a/app/views/layouts/base_forums.html.erb
+++ b/app/views/layouts/base_forums.html.erb
@@ -12,10 +12,10 @@
<%= csrf_meta_tag %>
<%= favicon %>
- <%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
+ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb
index 5145dbb2c..49f137df5 100644
--- a/app/views/mailer/_issue.html.erb
+++ b/app/views/mailer/_issue.html.erb
@@ -1,46 +1,43 @@
-
-
+
<%= link_to(h("#{@author.login}(#{@author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %>
- <%= l(:mail_issue_title_userin)%>
- <%= link_to(h("#{@issue.project.name}"), @project_url, :style=>'color:#1b55a7; font-weight:bold;') %><%= l(:mail_issue_title_active)%>
+ <%= l(:mail_issue_title_userin)%>
+
<%= link_to(h("#{@issue.project.name}"), @project_url, :style=>'color:#1b55a7; font-weight:bold;') %><%= l(:mail_issue_title_active)%>
+
-
- - <%= l(:mail_issue_subject)%><%= link_to(issue.subject, issue_url, :style=>'color:#1b55a7; font-weight:bold;') %>
- - <%= l(:mail_issue_sent_from)%><%= issue.project.name %>| <%= l(:mail_issue_from_project)%>
- - <%= l(:mail_issue_content)%>
+
+ - <%= l(:mail_issue_subject)%><%= link_to(issue.subject, issue_url, :style=>'color:#1b55a7; font-weight:bold;') %>
+ - <%= l(:mail_issue_sent_from)%><%= issue.project.name %>| <%= l(:mail_issue_from_project)%>
+ - <%= l(:mail_issue_content)%>
<% if @journal.nil? %>
- <%= issue.description=='' ? l(:label_none) : issue.description %>
+ <%= issue.description=='' ? l(:label_none) : issue.description.html_safe %>
<% else %>
- <%= @journal.notes=='' ? l(:label_none) : @journal.notes %>
+ <%= @journal.notes=='' ? l(:label_none) : @journal.notes.html_safe %>
<% end%>
-
<%= l(:mail_issue_attachments)%>
<% if @issue.attachments.count == 0 %>
- <%= l(:label_none)%>
+ <%= l(:label_none)%>
<% else %>
<% @issue.attachments.each do |attach| %>
<%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false, :style=>'color:#1b55a7; font-weight:bold;')%>
<% end %>
<% end %>
-
-
-
+
+ <%= link_to( l(:mail_issue_reply), issue_url, :class => "mail_reply", :style =>'display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px; line-height: 30px;') %>
+
<% unless @course_news.first.nil? %>
<% end %>
+
+ <% unless @course_news_comments.first.nil? %>
+
+
+ <%= l(:label_course_news) %>
+
+ <% @course_news_comments.each do |course_news_comment|%>
+ -
+ ▪
+ [
+ <% unless course_news_comment.commented.nil? %>
+ <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course, :token => @token.value),
+ :class=> "wmail_column",
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ <% end %>
+ ]
+
+ <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author,:token => @token.value), :class => "wmail_name",
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_project_notice) %>
+
+ <%= link_to truncate(course_news_comment.comments,length: 30,omission: '...'), news_url(course_news_comment.commented,:token => @token.value),
+ :class => 'wmail_info',
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ %>
+ <%= format_time(course_news_comment.created_on) %>
+
+ <% end %>
+
+
+ <% end %>
+
<% unless @bids.empty? %>
@@ -64,7 +97,6 @@
<% end %>
<% end %>
-
<% end %>
@@ -162,7 +194,8 @@
<% end %>
-<% if @issues.first || @project_messages.first || @wiki_contents.first || @project_news.first || @project_journal_messages.first %>
+<% if @issues.first || @project_messages.first || @issues_journals.first || @wiki_contents.first || @project_news.first || @project_news_comments.first || @project_journal_messages.first ||
+ @project_news_comments.first %>
<%= l(:label_project_overview_new)%>
<% unless @issues.first.nil? %>
@@ -192,6 +225,41 @@
<% end %>
+
+
+ <% unless @issues_journals.first.nil? %>
+
+
+ <%= l(:label_issue_tracking) %>
+
+ <% @issues_journals.each do |issues_journal| %>
+ -
+ ▪
+ [
+ <%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project, :token => @token.value),
+ :class=> "wmail_column",
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
+ <%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value), :class => "wmail_name",
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_project_issue) %>
+ <% if issues_journal.notes.nil? %>
+ <%= link_to truncate(issues_journal.issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value),
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ %>
+ <% else %>
+ <%= link_to truncate(issues_journal.notes,length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ %>
+ <% end %>
+ <%= format_time(issues_journal.created_on) %>
+
+ <% end %>
+
+
+
+ <% end %>
+
<% unless @project_messages.first.nil? %>
<% end %>
+
+ <% unless @project_news_comments.first.nil? %>
+
+
+ <%= l(:label_project_news) %>
+
+ <% @project_news_comments.each do |project_news_comment|%>
+ -
+ ▪
+ [
+ <% unless project_news_comment.commented.nil? %>
+ <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project, :token => @token.value),
+ :class=> "wmail_column",
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ <% end %>
+ ]
+ <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author,:token => @token.value), :class => "wmail_name",
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_project_mail_notice) %>
+
+ <%= link_to truncate(project_news_comment.comments.html_safe,length: 30,omission: '...'), news_url(project_news_comment.commented,:token => @token.value),
+ :class => 'wmail_info',
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ <%= format_time(project_news_comment.created_on) %>
+
+ <% end %>
+
+
+ <% end %>
+
+
+ <% unless @project_attachments.first.nil? %>
+
+
+ <%= l(:label_project_mail_attachments) %>
+
+ <% @project_attachments.each do |project_attachment|%>
+ -
+ ▪
+ [
+
+ <%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project, :token => @token.value),
+ :class=> "wmail_column",
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
+
+ <%= link_to project_attachment.author, user_activities_url(project_attachment.author,:token => @token.value), :class => "wmail_name",
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_project_mail_upload) %>
+
+ <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'), project_files_url(project_attachment.project,:token => @token.value),
+ :class => 'wmail_info',
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ %>
+ <%= format_time(project_attachment.created_on) %>
+
+ <% end %>
+
+
+ <% end %>
+
<% unless @project_journal_messages.first.nil? %>
diff --git a/app/views/mailer/send_for_user_activities.text.erb b/app/views/mailer/send_for_user_activities.text.erb
index c46e96f03..bcafb896f 100644
--- a/app/views/mailer/send_for_user_activities.text.erb
+++ b/app/views/mailer/send_for_user_activities.text.erb
@@ -1,344 +1,243 @@
<%= @subject %>
-<% if @attachments.first || @course_news.first || @bids.first ||
- @course_journal_messages.first|| @course_messages.first %>
-<%= l(:label_course_overview)%>
- <% unless @course_news.first.nil? %>
- <%= l(:label_course_news) %>
-
-
-
+<% if @attachments.first || @course_news.first || @course_news_comments.first || @bids.first ||
+ @course_journal_messages.first|| @course_messages.first || @attachments.first %>
+ <%= l(:label_course_overview)%>
+ <% unless @course_news.first.nil? %>
+ <%= l(:label_course_news) %>
<% @course_news.each do |course_new|%>
- ▪
- [
-
- <%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%>
- ]
-
- <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value)
- %>
- <%= l(:label_project_notice) %>
-
- <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value)
-
-
- %> <%= format_time(course_new.created_on) %>
+ ▪[<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%> ]
+ <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value) %>
+ <%= l(:label_project_notice) %>
+ <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value) %>
+ <%= format_time(course_new.created_on) %>
<% end %>
+ <% end %>
- <% end %>
- <% unless @bids.empty? %>
- <%= l(:label_homework_overview) %>
+ <% unless @course_news_comments.first.nil? %>
+ <%= l(:label_course_news) %>
+ <% @course_news_comments.each do |course_news_comment|%>
+ ▪[ <% unless course_news_comment.commented.nil? %>
+ <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course, :token => @token.value) %>
+ <% end %>
+ ]
+ <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author,:token => @token.value) %>
+ <%= l(:label_project_notice) %>
+ <%= link_to truncate(course_news_comment.comments,length: 30,omission: '...'), news_url(course_news_comment.commented,:token => @token.value) %>
+ <%= format_time(course_news_comment.created_on) %>
+ <% end %>
+ <% end %>
+
+ <% unless @bids.empty? %>
+ <%= l(:label_homework_overview) %>
<% unless @bids.first.nil?%>
<% @bids.each do |bid| %>
- ▪
- [
-
- <%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value)
-
- %>
- ]
-
- <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value)
- %>
- <%= l(:label_course_homework) %>
-
- <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value)
-
-
- %>
- <%= format_time(bid.created_at) %>
-
+ ▪[<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value) %>]
+ <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value) %>
+ <%= l(:label_course_homework) %>
+ <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value) %>
+ <%= format_time(bid.created_at) %>
<% end %>
<% end %>
+
+ <% end %>
-
-
- <% end %>
-
- <% unless @course_journal_messages.first.nil? %>
-
- <%= l(:view_course_journals_for_messages) %>
-
-
+ <% unless @course_journal_messages.first.nil? %>
+ <%= l(:view_course_journals_for_messages) %>
<% @course_journal_messages.each do |course_journal_message|%>
-
- [
-
- <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value)
-
- %>
- ]
-
- <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value)
- %>
+ [ <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value) %>]
+ <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value) %>
<%= l(:label_send_course_journals_for_messages) %>
-
- <%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value)
-
-
- %>
- <%= format_time(course_journal_message.created_on) %>
-
+ <%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value) %>
+ <%= format_time(course_journal_message.created_on) %>
<% end %>
+ <% end %>
-
- <% end %>
-
- <% unless @course_messages.first.nil? %>
-
- <%= l(:view_borad_course) %>
-
-
-
+ <% unless @course_messages.first.nil? %>
+ <%= l(:view_borad_course) %>
<% @course_messages.each do |course_message|%>
-
- ▪
- [
-
- <%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)
-
- %>
- ]
-
- <%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value)
- %>
- <%= l(:label_send_course_messages) %>
-
- <%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value)
-
-
- %>
- <%= format_time(course_message.created_on) %>
-
+ ▪[<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)%>]
+ <%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value) %>
+ <%= l(:label_send_course_messages) %>
+ <%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value) %>
+ <%= format_time(course_message.created_on) %>
<% end %>
+ <% end %>
-
- <% end %>
-
- <% unless @attachments.first.nil? %>
-
- <%= l(:label_course_attendingcontestwork_download) %>
-
-
-
+ <% unless @attachments.first.nil? %>
+ <%= l(:label_course_attendingcontestwork_download) %>
<% @attachments.each do |attachment|%>
- ▪[
-
- <%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value)
-
- %>
- ]
-
- <%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value)
- %>
- <%= l(:label_course_file_upload) %>
-
- <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value)
-
-
- %>
- <%= format_time(attachment.created_on) %>
-
+ ▪[<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value) %>]
+ <%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value) %>
+ <%= l(:label_course_file_upload) %>
+ <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value) %>
+ <%= format_time(attachment.created_on) %>
<% end %>
-
-
- <% end %>
+
+ <% end %>
<% end %>
-<% @issues.first || @project_messages.first || @wiki_contents.first || @project_news.first || @project_journal_messages.first %>
-<%= l(:label_project_overview_new)%>
- <% unless @issues.first.nil? %>
-
- <%= l(:label_issue_tracking) %>
-
-
+
+
+<% if @issues.first || @project_messages.first || @issues_journals.first || @wiki_contents.first || @project_news.first || @project_news_comments.first || @project_journal_messages.first ||
+ @project_news_comments.first %>
+ <%= l(:label_project_overview_new)%>
+ <% unless @issues.first.nil? %>
+ <%= l(:label_issue_tracking) %>
<% @issues.each do |issue|%>
- ▪
- [
-
- <%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value)
-
- %>
- ]
-
- <%= link_to issue.author, user_activities_url(issue.author,:token => @token.value)
- %>
- <%= l(:label_project_issue) %>
-
- <%= link_to truncate(issue. subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value)
-
-
- %>
- <%= format_time(issue.created_on) %>
+ ▪[<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value) %>]
+ <%= link_to issue.author, user_activities_url(issue.author,:token => @token.value) %>
+ <%= l(:label_project_issue) %>
+ <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %>
+ <%= format_time(issue.created_on) %>
<% end %>
+
+ <% end %>
+
+ <% unless @issues_journals.first.nil? %>
+ <%= l(:label_issue_tracking) %>
+ <% @issues_journals.each do |issues_journal| %>
+ ▪[<%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project, :token => @token.value) %>]
+ <%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value) %>
+ <%= l(:label_project_issue) %>
+ <% if issues_journal.notes.nil? %>
+ <%= link_to truncate(issues_journal.issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %>
+ <% else %>
+ <%= link_to truncate(issues_journal.notes,length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value) %>
+ <% end %>
+ <%= format_time(issues_journal.created_on) %>
+ <% end %>
+ <% end %>
- <% end %>
-
- <% unless @project_messages.first.nil? %>
-
- <%= l(:project_moule_boards_show) %>
-
-
+
+ <% unless @project_messages.first.nil? %>
+ <%= l(:project_moule_boards_show) %>
<% @project_messages.each do |project_message|%>
- ▪[
-
- <%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value)
-
- %>
- ]
-
- <%= link_to project_message.author, board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value)
- %>
- <%= l(:label_send_course_messages) %>
-
- <%= link_to truncate(project_message. subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value)
-
-
- %>
- <%= format_time(project_message.created_on) %>
+ ▪[<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value) %>]
+ <%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value) %>
+ <%= l(:label_send_course_messages) %>
+ <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value) %>
+ <%= format_time(project_message.created_on) %>
<% end %>
+
+ <% end %>
+
<% unless @wiki_contents.first.nil? %>
-
- <%= l(:label_wiki) %>
-
- <% @wiki_contents.each do |wikicontent|%>
- ▪[
- <% unless wikicontent.page.nil? %>
- <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value)
- %>
- <% end %>
- ]
- <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value) %>
- <%= l(:label_project_notice) %>
- <% unless wikicontent.page.nil? %>
- <%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value) %>
- <% end %>
- <%= format_time(wikicontent.updated_on) %>
-
- <% end %>
+ <%= l(:label_wiki) %>
+ <% @wiki_contents.each do |wikicontent|%>
+ ▪[<% unless wikicontent.page.nil? %>
+ <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value) %>
+ <% end %>
+ ]
+ <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value) %>
+ <%= l(:label_wiki_mail_notification) %>
+ <% unless wikicontent.page.nil? %>
+ <%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value) %>
+ <% end %>
+ <%= format_time(wikicontent.updated_on) %>
+ <% end %>
<% end %>
<% unless @project_news.first.nil? %>
+ <%= l(:label_project_news) %>
+ <% @project_news.each do |project_new|%>
+ ▪[<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value) %> ]
+ <%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value) %>
+ <%= l(:label_project_mail_notice) %>
+ <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value) %>
+ <%= format_time(project_new.created_on) %>
+ <% end %>
+ <% end %>
- <%= l(:label_project_news) %>
+
+ <% unless @project_news_comments.first.nil? %>
+ <%= l(:label_project_news) %>
+ <% @project_news_comments.each do |project_news_comment|%>
+ ▪[ <% unless project_news_comment.commented.nil? %>
+ <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project, :token => @token.value) %>
+ <% end %>]
+ <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author,:token => @token.value) %>
+ <%= l(:label_project_mail_notice) %>
+ <%= link_to truncate(project_news_comment.comments.html_safe,length: 30,omission: '...'), news_url(project_news_comment.commented,:token => @token.value) %>
+ <%= format_time(project_news_comment.created_on) %>
+ <% end %>
+
+ <% end %>
- <% @project_news.each do |project_new|%>
- ▪[
-
- <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value)
- %>
- ]
- <%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value)
- %>
- <%= l(:label_project_notice) %>
-
- <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value)
- %>
- <%= format_time(project_new.created_on) %>
-
- <% end %>
+
+ <% unless @project_attachments.first.nil? %>
+ <%= l(:label_project_mail_attachments) %>
+ <% @project_attachments.each do |project_attachment|%>
+ ▪[<%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project, :token => @token.value) %>]
+ <%= link_to project_attachment.author, user_activities_url(project_attachment.author,:token => @token.value) %>
+ <%= l(:label_project_mail_upload) %>
+ <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'),project_files_url(project_attachment.project,:token => @token.value) %>
+ <%= format_time(project_attachment.created_on) %>
+ <% end %>
<% end %>
<% unless @project_journal_messages.first.nil? %>
- <%= l(:label_project_mail_feedback) %>
-
- <% @project_journal_messages.each do |project_journal_message|%>
- ▪[
-
- <%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value)
- %>
- ]
-
- <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value) %>
- <%= l(:label_send_course_journals_for_messages) %>
-
- <%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value)
- %>
- <%= format_time(project_journal_message.created_on) %>
- <% end %>
+ <%= l(:label_project_mail_feedback) %>
+ <% @project_journal_messages.each do |project_journal_message|%>
+ ▪[<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value) %> ]
+ <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value) %>
+ <%= l(:label_send_course_journals_for_messages) %>
+ <%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value) %>
+ <%= format_time(project_journal_message.created_on) %>
+ <% end %>
+
<% end %>
+
+<% end %>
- <% end %>
<% unless @user_journal_messages.first.nil? %>
-<%= l(:label_activities) %>
-
-
- <%= l(:label_user_message) %>
- (<%= @user_journal_messages.count %>)
-
- <% @user_journal_messages.each do |user_journal_message|%>
- ▪
-
- <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)
-
- %>
- <%= l(:label_show_your_message) %>
-
- <%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'), feedback_url(@user,:token => @token.value)
-
-
- %>
- <%= format_time(user_journal_message.created_on) %>
-
- <% end %>
-
-
+ <%= l(:label_activities) %>
+ <%= l(:label_user_message) %>
+ (<%= @user_journal_messages.count %>)
+ <% @user_journal_messages.each do |user_journal_message|%>
+ ▪ <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)%>
+ <%= l(:label_show_your_message) %>
+ <%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'), feedback_url(@user,:token => @token.value) %>
+ <%= format_time(user_journal_message.created_on) %>
+ <% end %>
<% end %>
+
<% if @forums.first || @memos.first %>
<%= l(:lable_bar_active) %>
- <% unless @forums.first.nil? %>
-
- <%= l(:label_user_forum) %>
-
-
- <% @forums.each do |forum|%>
- ▪
-
- <%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value) %>
- <%= l(:label_forum_new) %>
-
- <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value)
- %>
- <%= format_time(forum.created_at) %>
-
- <% end %>
-
-
- <% end %>
- <% unless @memos.first.nil? %>
-
- <%= l(:label_user_message_forum) %>
-
-
- <% @memos.each do |memo|%>
- ▪
-
- <%= link_to memo.author, user_activities_url(memo.author,:token => @token.value)%>
- <%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %>
-
- <%= link_to truncate(memo.subject,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id))
- %>
- <%= format_time(memo.created_at) %>
-
- <% end %>
-
-
-
- <% end %>
+ <% unless @forums.first.nil? %>
+ <%= l(:label_user_forum) %>
+ <% @forums.each do |forum|%>
+ ▪<%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value) %>
+ <%= l(:label_forum_new) %>
+ <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value) %>
+ <%= format_time(forum.created_at) %>
+ <% end %>
+
+ <% end %>
+ <% unless @memos.first.nil? %>
+ <%= l(:label_user_message_forum) %>
+ <% @memos.each do |memo|%>
+ ▪<%= link_to memo.author, user_activities_url(memo.author,:token => @token.value)%>
+ <%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %>
+ <%= link_to truncate(memo.subject,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id))%>
+ <%= format_time(memo.created_at) %>
+ <% end %>
+
+ <% end %>
<% end %>
<% [:label_user_mail_option_all, :label_user_mail_option_day, :label_user_mail_option_none].each do |mail_option| %>
- <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %>
- <%= l(mail_option) %>
- <% else %>
- <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %>
- <% end %>
+ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %>
+ <%= l(mail_option) %>
+ <% else %>
+ <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %>
+ <% end %>
<% end %>
diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb
index 6328edcac..487d923b5 100644
--- a/app/views/memos/edit.html.erb
+++ b/app/views/memos/edit.html.erb
@@ -1,6 +1,6 @@
<% @replying = !@memo.parent.nil? %>
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%=l(:label_memo_edit)%>
<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %>
<% if @memo.errors.any? %>
diff --git a/app/views/memos/new.html.erb b/app/views/memos/new.html.erb
index 8a1863047..792c8d55a 100644
--- a/app/views/memos/new.html.erb
+++ b/app/views/memos/new.html.erb
@@ -4,7 +4,7 @@
@nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%>
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb
index 05358c32a..55a2410b0 100644
--- a/app/views/memos/show.html.erb
+++ b/app/views/memos/show.html.erb
@@ -4,7 +4,7 @@
margin-bottom: 13px;
}
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
diff --git a/app/views/messages/_form_course.html.erb b/app/views/messages/_form_course.html.erb
index 1161e9f8a..7952e4820 100644
--- a/app/views/messages/_form_course.html.erb
+++ b/app/views/messages/_form_course.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= error_messages_for 'message' %>
<% replying ||= false %>
<% extra_option = replying ? { hidden: "hidden"} : { maxlength: 200 } %>
diff --git a/app/views/news/_course_form.html.erb b/app/views/news/_course_form.html.erb
index 1769c98f3..0a5488714 100644
--- a/app/views/news/_course_form.html.erb
+++ b/app/views/news/_course_form.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
@@ -37,4 +37,4 @@
<% end %>
-
\ No newline at end of file
+
diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb
index 4d1242883..f39eb8266 100644
--- a/app/views/news/_course_show.html.erb
+++ b/app/views/news/_course_show.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= l(:label_course_news) %>
@@ -76,4 +76,4 @@
<% end %>
-<% html_title @news.title -%>
\ No newline at end of file
+<% html_title @news.title -%>
diff --git a/app/views/news/_project_form.html.erb b/app/views/news/_project_form.html.erb
index b9698497d..dfe1fb937 100644
--- a/app/views/news/_project_form.html.erb
+++ b/app/views/news/_project_form.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
@@ -33,4 +33,4 @@
<% end %>
-
\ No newline at end of file
+
diff --git a/app/views/news/edit.html.erb b/app/views/news/edit.html.erb
index 758976d1b..5fbae6f72 100644
--- a/app/views/news/edit.html.erb
+++ b/app/views/news/edit.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= l(:label_course_news) %>
@@ -8,4 +8,4 @@
<%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %>
<% end %>
-
\ No newline at end of file
+
diff --git a/app/views/projects/_project_jours.html.erb b/app/views/projects/_project_jours.html.erb
index 1a7d3c5d5..baee72475 100644
--- a/app/views/projects/_project_jours.html.erb
+++ b/app/views/projects/_project_jours.html.erb
@@ -11,7 +11,7 @@
div.recall_con{width:570px;}
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= l(:label_user_response) %>
@@ -197,4 +197,4 @@
});
});
});
-
\ No newline at end of file
+
diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb
index f63c1792b..dfa995f47 100644
--- a/app/views/student_work/edit.html.erb
+++ b/app/views/student_work/edit.html.erb
@@ -12,7 +12,7 @@
- <%= labelled_form_for @work do |f|%>
+ <%= labelled_form_for @work,:html => { :multipart => true } do |f|%>
@@ -57,4 +57,4 @@
-
\ No newline at end of file
+
diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb
index c9e8cd4c6..6325abc09 100644
--- a/app/views/student_work/index.html.erb
+++ b/app/views/student_work/index.html.erb
@@ -18,7 +18,6 @@
返
回
顶
部
-
@@ -37,6 +36,7 @@
<% if @show_all%>
搜索
+ <%= link_to "缺评情况",student_work_absence_penalty_student_work_index_path(:homework => @homework.id), :class => "student_work_search fl", :target => "_blank" if @is_teacher%>
<% end%>
<% if @is_teacher%>
diff --git a/app/views/student_work/student_work_absence_penalty.html.erb b/app/views/student_work/student_work_absence_penalty.html.erb
new file mode 100644
index 000000000..e9054561f
--- /dev/null
+++ b/app/views/student_work/student_work_absence_penalty.html.erb
@@ -0,0 +1,50 @@
+
+
+ 缺评情况
+
+
+
+
+
+
+ -
+ 学号
+
+ -
+ 姓名
+
+ -
+ 应评
+
+ -
+ 实评
+
+ -
+ <%= link_to "缺评",student_work_absence_penalty_student_work_index_path(:homework => @homework.id,:order => @order)%>
+
+
+
+
+
+ <% @stundet_works.each do |student_work|%>
+
" id="student_work_<%= student_work.id%>">
+ -
+
+ <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
+
+
+ -
+ <%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
+
+ -
+ <%= student_work.all_count%>
+
+ -
+ <%= student_work.has_count%>
+
+ -
+ <%= student_work.absence%>
+
+
+ <% end%>
+
\ No newline at end of file
diff --git a/app/views/users/_user_jours.html.erb b/app/views/users/_user_jours.html.erb
index c74f68a24..9d7a601d5 100644
--- a/app/views/users/_user_jours.html.erb
+++ b/app/views/users/_user_jours.html.erb
@@ -11,7 +11,7 @@
div.recall_con{width:600px;}
div.recall_con .reply_btn{margin-left:555px;margin-top:5px;}
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
diff --git a/config/locales/mailers/zh.yml b/config/locales/mailers/zh.yml
index 46666ee25..211f2e62d 100644
--- a/config/locales/mailers/zh.yml
+++ b/config/locales/mailers/zh.yml
@@ -21,3 +21,6 @@ zh:
mail_issue_from_project: "项目问题跟踪"
mail_issue_attachments: "附件:"
mail_issue_reply: "我要回复"
+ mail_course_title_userin: "在课程"
+ mail_course_homework_active: "中发布了作业"
+ mail_attention: "请您关注!"
diff --git a/config/locales/projects/en.yml b/config/locales/projects/en.yml
index 57ef221b0..b142c6ca8 100644
--- a/config/locales/projects/en.yml
+++ b/config/locales/projects/en.yml
@@ -41,7 +41,9 @@ en:
lable_sure_exit_project: "Are you sure exit from the projcet"
label_member: "Members"
- project_module_attachments: "Resources"
+ project_module_attachments: "Resources"
+ label_project_mail_attachments: Project Resources
+ label_project_mail_upload: had uploaded project resources
label_invite: Invitation
label_invite_new_user: "Send email to invite new user"
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index 42eea8dcc..5bf8957bf 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -62,7 +62,9 @@ zh:
label_development_team: 开发模式
label_member: 成员
- project_module_attachments: 资源
+ project_module_attachments: 资源
+ label_project_mail_attachments: 项目资源
+ label_project_mail_upload: 上传了资源
label_invite: 邀请
diff --git a/config/routes.rb b/config/routes.rb
index c92c732d2..b5a244345 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -97,6 +97,7 @@ RedmineApp::Application.routes.draw do
collection do
post 'add_score_reply'
get 'destroy_score_reply'
+ get 'student_work_absence_penalty'
end
end
diff --git a/config/settings.yml b/config/settings.yml
index cf98025e0..d0af6d7a1 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -66,7 +66,8 @@ upload_avatar_max_size:
### delayjob for send email.
delayjob_enabled:
default: 1
-
+course_cahce_enabled:
+ default: 1
bcc_recipients:
default: 1
plain_text_mail:
@@ -89,6 +90,12 @@ host_user:
default: user.trustie.net
host_repository:
default: repository.trustie.net
+url_course:
+ default: course.trustie.net
+url_contest:
+ default: contest.trustie.net
+url_user:
+ default: user.trustie.net
protocol:
default: http
feeds_limit:
diff --git a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb
index 1f4c867ba..d5f91ebf8 100644
--- a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb
+++ b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb
@@ -16,7 +16,8 @@ module RailsKindeditor
input_html = input_html.merge(style: 'display:none')
output_buffer = ActiveSupport::SafeBuffer.new
output_buffer << build_text_area_tag(name, method, self, options, input_html)
- output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true')))
+ output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
+ afterCreate: 'eval(function(){enablePasteImg(self);})')))
end
def kindeditor_upload_json_path(*args)
@@ -52,12 +53,12 @@ module RailsKindeditor
"var old_onload_#{random_name};
if(typeof window.onload == 'function') old_onload_#{random_name} = window.onload;
window.onload = function() {
- #{editor_id}KindEditor.create('##{dom_id}', #{get_options(options).to_json}).loadPlugin('paste');
+ #{editor_id}KindEditor.create('##{dom_id}', #{get_options(options).to_json});
if(old_onload_#{random_name}) old_onload_#{random_name}();
}"
else
"KindEditor.ready(function(K){
- #{editor_id}K.create('##{dom_id}', #{get_options(options).to_json}).loadPlugin('paste');
+ #{editor_id}K.create('##{dom_id}', #{get_options(options).to_json});
});"
end
end
diff --git a/lib/trustie/cache/clear_course_event.rb b/lib/trustie/cache/clear_course_event.rb
new file mode 100644
index 000000000..a5f44bf45
--- /dev/null
+++ b/lib/trustie/cache/clear_course_event.rb
@@ -0,0 +1,31 @@
+#coding=utf-8
+
+module Trustie
+ module Cache
+ module ClearCourseEvent
+ def self.included(base)
+ base.class_eval{
+ after_create :clear_course_events
+ }
+ end
+
+ def clear_course_events
+ if Rails.env.production? && Setting.course_cahce_enabled?
+ Rails.cache.delete(cache_key)
+ end
+ end
+
+ def cache_key
+ course_id = nil
+ if Message === self.act
+ course_id = self.act.board.course_id
+ elsif self.act.respond_to?(:course_id)
+ course_id = self.act.course_id
+ end
+ "course_events_#{course_id}".to_sym
+ end
+
+ end
+ end
+end
+
diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js
index 1695b10f7..a9633861e 100644
--- a/public/assets/kindeditor/kindeditor.js
+++ b/public/assets/kindeditor/kindeditor.js
@@ -5097,6 +5097,9 @@ KEditor.prototype = {
}
self.afterCreate();
if (self.options.afterCreate) {
+ if (typeof self.options.afterCreate == 'string'){
+ self.options.afterCreate = eval(self.options.afterCreate);
+ }
self.options.afterCreate.call(self);
}
}
diff --git a/public/assets/kindeditor/pasteimg.js b/public/assets/kindeditor/pasteimg.js
new file mode 100644
index 000000000..c413bbcb9
--- /dev/null
+++ b/public/assets/kindeditor/pasteimg.js
@@ -0,0 +1,385 @@
+// Generated by CoffeeScript 1.9.0
+
+/*
+paste.js is an interface to read data ( text / image ) from clipboard in different browsers. It also contains several hacks.
+https://github.com/layerssss/paste.js
+ */
+
+(function() {
+ var $, Paste, createHiddenEditable, dataURLtoBlob;
+
+ $ = window.jQuery;
+
+ $.paste = function(pasteContainer) {
+ var pm;
+ if (typeof console !== "undefined" && console !== null) {
+ console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead.");
+ }
+ pm = Paste.mountNonInputable(pasteContainer);
+ return pm._container;
+ };
+
+ $.fn.pastableNonInputable = function() {
+ var el, _i, _len;
+ for (_i = 0, _len = this.length; _i < _len; _i++) {
+ el = this[_i];
+ Paste.mountNonInputable(el);
+ }
+ return this;
+ };
+
+ $.fn.pastableTextarea = function() {
+ var el, _i, _len;
+ for (_i = 0, _len = this.length; _i < _len; _i++) {
+ el = this[_i];
+ Paste.mountTextarea(el);
+ }
+ return this;
+ };
+
+ $.fn.pastableContenteditable = function() {
+ var el, _i, _len;
+ for (_i = 0, _len = this.length; _i < _len; _i++) {
+ el = this[_i];
+ Paste.mountContenteditable(el);
+ }
+ return this;
+ };
+
+ dataURLtoBlob = function(dataURL, sliceSize) {
+ var b64Data, byteArray, byteArrays, byteCharacters, byteNumbers, contentType, i, m, offset, slice, _ref;
+ if (sliceSize == null) {
+ sliceSize = 512;
+ }
+ if (!(m = dataURL.match(/^data\:([^\;]+)\;base64\,(.+)$/))) {
+ return null;
+ }
+ _ref = m, m = _ref[0], contentType = _ref[1], b64Data = _ref[2];
+ byteCharacters = atob(b64Data);
+ byteArrays = [];
+ offset = 0;
+ while (offset < byteCharacters.length) {
+ slice = byteCharacters.slice(offset, offset + sliceSize);
+ byteNumbers = new Array(slice.length);
+ i = 0;
+ while (i < slice.length) {
+ byteNumbers[i] = slice.charCodeAt(i);
+ i++;
+ }
+ byteArray = new Uint8Array(byteNumbers);
+ byteArrays.push(byteArray);
+ offset += sliceSize;
+ }
+ return new Blob(byteArrays, {
+ type: contentType
+ });
+ };
+
+ createHiddenEditable = function() {
+ return $(document.createElement('div')).attr('contenteditable', true).css({
+ width: 1,
+ height: 1,
+ position: 'fixed',
+ left: -100,
+ overflow: 'hidden'
+ });
+ };
+
+ Paste = (function() {
+ Paste.prototype._target = null;
+
+ Paste.prototype._container = null;
+
+ Paste.mountNonInputable = function(nonInputable) {
+ var paste;
+ paste = new Paste(createHiddenEditable().appendTo(nonInputable), nonInputable);
+ $(nonInputable).on('click', (function(_this) {
+ return function() {
+ return paste._container.focus();
+ };
+ })(this));
+ paste._container.on('focus', (function(_this) {
+ return function() {
+ return $(nonInputable).addClass('pastable-focus');
+ };
+ })(this));
+ return paste._container.on('blur', (function(_this) {
+ return function() {
+ return $(nonInputable).removeClass('pastable-focus');
+ };
+ })(this));
+ };
+
+ Paste.mountTextarea = function(textarea) {
+ var ctlDown, paste;
+ if (-1 !== navigator.userAgent.toLowerCase().indexOf('chrome')) {
+ return this.mountContenteditable(textarea);
+ }
+ paste = new Paste(createHiddenEditable().insertBefore(textarea), textarea);
+ ctlDown = false;
+ $(textarea).on('keyup', function(ev) {
+ var _ref;
+ if ((_ref = ev.keyCode) === 17 || _ref === 224) {
+ return ctlDown = false;
+ }
+ });
+ $(textarea).on('keydown', function(ev) {
+ var _ref;
+ if ((_ref = ev.keyCode) === 17 || _ref === 224) {
+ ctlDown = true;
+ }
+ if (ctlDown && ev.keyCode === 86) {
+ return paste._container.focus();
+ }
+ });
+ $(paste._target).on('pasteImage', (function(_this) {
+ return function() {
+ return $(textarea).focus();
+ };
+ })(this));
+ $(paste._target).on('pasteText', (function(_this) {
+ return function() {
+ return $(textarea).focus();
+ };
+ })(this));
+ $(textarea).on('focus', (function(_this) {
+ return function() {
+ return $(textarea).addClass('pastable-focus');
+ };
+ })(this));
+ return $(textarea).on('blur', (function(_this) {
+ return function() {
+ return $(textarea).removeClass('pastable-focus');
+ };
+ })(this));
+ };
+
+ Paste.mountContenteditable = function(contenteditable) {
+ var paste;
+ paste = new Paste(contenteditable, contenteditable);
+ $(contenteditable).on('focus', (function(_this) {
+ return function() {
+ return $(contenteditable).addClass('pastable-focus');
+ };
+ })(this));
+ return $(contenteditable).on('blur', (function(_this) {
+ return function() {
+ return $(contenteditable).removeClass('pastable-focus');
+ };
+ })(this));
+ };
+
+ function Paste(_at__container, _at__target) {
+ this._container = _at__container;
+ this._target = _at__target;
+ this._container = $(this._container);
+ this._target = $(this._target).addClass('pastable');
+ this._container.on('paste', (function(_this) {
+ return function(ev) {
+ var clipboardData, file, item, reader, text, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _results;
+ if (((_ref = ev.originalEvent) != null ? _ref.clipboardData : void 0) != null) {
+ clipboardData = ev.originalEvent.clipboardData;
+ if (clipboardData.items) {
+ _ref1 = clipboardData.items;
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ item = _ref1[_i];
+ if (item.type.match(/^image\//)) {
+ reader = new FileReader();
+ reader.onload = function(event) {
+ return _this._handleImage(event.target.result);
+ };
+ reader.readAsDataURL(item.getAsFile());
+ }
+ if (item.type === 'text/plain') {
+ item.getAsString(function(string) {
+ return _this._target.trigger('pasteText', {
+ text: string
+ });
+ });
+ }
+ }
+ } else {
+ if (-1 !== Array.prototype.indexOf.call(clipboardData.types, 'text/plain')) {
+ text = clipboardData.getData('Text');
+ _this._target.trigger('pasteText', {
+ text: text
+ });
+ }
+ _this._checkImagesInContainer(function(src) {
+ return _this._handleImage(src);
+ });
+ }
+ }
+ if (clipboardData = window.clipboardData) {
+ if ((_ref2 = (text = clipboardData.getData('Text'))) != null ? _ref2.length : void 0) {
+ return _this._target.trigger('pasteText', {
+ text: text
+ });
+ } else {
+ _ref3 = clipboardData.files;
+ _results = [];
+ for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
+ file = _ref3[_j];
+ _this._handleImage(URL.createObjectURL(file));
+ _results.push(_this._checkImagesInContainer(function() {}));
+ }
+ return _results;
+ }
+ }
+ };
+ })(this));
+ }
+
+ Paste.prototype._handleImage = function(src) {
+ var loader;
+ loader = new Image();
+ loader.onload = (function(_this) {
+ return function() {
+ var blob, canvas, ctx, dataURL;
+ canvas = document.createElement('canvas');
+ canvas.width = loader.width;
+ canvas.height = loader.height;
+ ctx = canvas.getContext('2d');
+ ctx.drawImage(loader, 0, 0, canvas.width, canvas.height);
+ dataURL = null;
+ try {
+ dataURL = canvas.toDataURL('image/png');
+ blob = dataURLtoBlob(dataURL);
+ } catch (_error) {}
+ if (dataURL) {
+ return _this._target.trigger('pasteImage', {
+ blob: blob,
+ dataURL: dataURL,
+ width: loader.width,
+ height: loader.height
+ });
+ }
+ };
+ })(this);
+ return loader.src = src;
+ };
+
+ Paste.prototype._checkImagesInContainer = function(cb) {
+ var img, timespan, _i, _len, _ref;
+ timespan = Math.floor(1000 * Math.random());
+ _ref = this._container.find('img');
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ img = _ref[_i];
+ img["_paste_marked_" + timespan] = true;
+ }
+ return setTimeout((function(_this) {
+ return function() {
+ var _j, _len1, _ref1, _results;
+ _ref1 = _this._container.find('img');
+ _results = [];
+ for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+ img = _ref1[_j];
+ if (!img["_paste_marked_" + timespan]) {
+ cb(img.src);
+ }
+ _results.push($(img).remove());
+ }
+ return _results;
+ };
+ })(this), 1);
+ };
+
+ return Paste;
+
+ })();
+
+}).call(this);
+
+function enablePasteImg(_editor) {
+ var editor = _editor,
+ name = 'paste';
+ //òƶ༭Ͳͻ
+ if(editor.edit == undefined || editor.edit.iframe == undefined){
+ return;
+ }
+ var contentWindow = editor.edit.iframe[0].contentWindow;
+ //var contentWindow = editor.iframeDoc;
+ //var contentWindow = document.getElementsByTagName('iframe')[0].contentWindow;
+ var nodeBody = contentWindow.document.getElementsByTagName('body')[0];
+ console.log(nodeBody);
+ $(nodeBody).pastableContenteditable();
+
+ dataURItoBlob = function(dataURI) {
+ // convert base64/URLEncoded data component to raw binary data held in a string
+ var byteString;
+ if (dataURI.split(',')[0].indexOf('base64') >= 0)
+ byteString = atob(dataURI.split(',')[1]);
+ else
+ byteString = unescape(dataURI.split(',')[1]);
+
+ // separate out the mime component
+ var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
+
+ // write the bytes of the string to a typed array
+ var ia = new Uint8Array(byteString.length);
+ for (var i = 0; i < byteString.length; i++) {
+ ia[i] = byteString.charCodeAt(i);
+ }
+
+ return new Blob([ia], {type:mimeString});
+ };
+
+ $(nodeBody).on('pasteImage', function(ev, data) {
+ console.log('pasteImage');
+ console.log("dataURL: " + data.dataURL);
+ console.log("width: " + data.width);
+ console.log("height: " + data.height);
+ console.log(data.blob);
+ var blob = dataURItoBlob(data.dataURL);
+ if (data.blob !== null) {
+ var data = new FormData();
+ data.append("imgFile",blob, "imageFilename.png");
+ console.log(data);
+ $.ajax({
+ url: '/kindeditor/upload?dir=image',
+ contentType: false,
+ type: 'POST',
+ data: data,
+ processData: false,
+ success: function(data) {
+ editor.exec('insertimage', JSON.parse(data).url);
+ }
+ });
+ }
+
+ });
+ return;
+ contentWindow.document.getElementsByTagName('body')[0].onpaste = function(event) {
+ // use event.originalEvent.clipboard for newer chrome versions
+ var items = (event.clipboardData || event.originalEvent.clipboardData).items;
+ console.log(JSON.stringify(items)); // will give you the mime types
+ // find pasted image among pasted items
+ var blob = null;
+ for (var i = 0; i < items.length; i++) {
+ if (items[i].type.indexOf("image") === 0) {
+ blob = items[i].getAsFile();
+ }
+ }
+ // load image if there is a pasted image
+ if (blob !== null) {
+ var reader = new FileReader();
+ reader.onload = function(event) {
+ console.log(event.target.result); // data url!
+ var data = new FormData();
+ data.append("imgFile", blob, "imageFilename.png");
+ console.log(blob);
+ $.ajax({
+ url: '/kindeditor/upload?dir=image',
+ contentType: false,
+ type: 'POST',
+ data: data,
+ processData: false,
+ success: function(data) {
+ editor.exec('insertimage', JSON.parse(data).url);
+ }
+ });
+ };
+ reader.readAsDataURL(blob);
+ }
+ }
+};
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 3df755a7f..9c32e41dc 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -1,8 +1,7 @@
/* Redmine - project management software
Copyright (C) 2006-2013 Jean-Philippe Lang */
-function postUpMsg(attachmentId)
-{
+function postUpMsg(attachmentId) {
$.ajax({
url: '/attachments/renderTag',
type: "GET",
@@ -30,28 +29,57 @@ function addFile_board(inputEl, file, eagerUpload, id) {
deleteallfiles = $(inputEl).data('deleteAllFiles');
var attachmentId = addFile.nextAttachmentId++;
- var fileSpan = $('
', { 'id': 'attachments_' + attachmentId, 'class':'attachment' });
+ var fileSpan = $('', {
+ 'id': 'attachments_' + attachmentId,
+ 'class': 'attachment'
+ });
fileSpan.append(
- $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name),
- $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('descriptionPlaceholder') } ).toggle(!eagerUpload),
- $(''+$(inputEl).data('fieldIsPublic')+':').attr({ 'class': 'ispublic-label' }) ,
- $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload),
- $(' ').attr({ 'href': "#", 'class': 'remove-upload', 'data-containerid':id }).click(function(){
- if(confirm($(inputEl).data('areYouSure'))){
+ $('', {
+ 'type': 'text',
+ 'class': 'filename readonly',
+ 'name': 'attachments[' + attachmentId + '][filename]',
+ 'readonly': 'readonly'
+ }).val(file.name),
+ $('', {
+ 'type': 'text',
+ 'class': 'description',
+ 'name': 'attachments[' + attachmentId + '][description]',
+ 'maxlength': 254,
+ 'placeholder': $(inputEl).data('descriptionPlaceholder')
+ }).toggle(!eagerUpload),
+ $('' + $(inputEl).data('fieldIsPublic') + ':').attr({
+ 'class': 'ispublic-label'
+ }),
+ $('', {
+ 'type': 'checkbox',
+ 'class': 'is_public_checkbox',
+ 'value': 1,
+ 'name': 'attachments[' + attachmentId + '][is_public_checkbox]',
+ checked: 'checked'
+ }).toggle(!eagerUpload),
+ $(' ').attr({
+ 'href': "#",
+ 'class': 'remove-upload',
+ 'data-containerid': id
+ }).click(function() {
+ if (confirm($(inputEl).data('areYouSure'))) {
removeFile();
- if(!eagerUpload){
- (function(e){
+ if (!eagerUpload) {
+ (function(e) {
reload(e);
})(fileSpan);
}
}
}).toggle(!eagerUpload),
- $('', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} )
+ $('
', {
+ 'class': 'div_attachments',
+ 'name': 'div_' + 'attachments_' + attachmentId
+ })
).appendTo(attachments_frame);
- if(eagerUpload) {
+ if (eagerUpload) {
ajaxUpload(file, attachmentId, fileSpan, inputEl);
}
@@ -59,6 +87,7 @@ function addFile_board(inputEl, file, eagerUpload, id) {
}
return null;
}
+
function addFile(inputEl, file, eagerUpload) {
var attachments_frame = '#attachments_fields';
@@ -66,28 +95,56 @@ function addFile(inputEl, file, eagerUpload) {
deleteallfiles = $(inputEl).data('deleteAllFiles');
var attachmentId = addFile.nextAttachmentId++;
- var fileSpan = $('
', { 'id': 'attachments_' + attachmentId, 'class':'attachment' });
+ var fileSpan = $('', {
+ 'id': 'attachments_' + attachmentId,
+ 'class': 'attachment'
+ });
fileSpan.append(
- $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name),
- $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('descriptionPlaceholder') } ).toggle(!eagerUpload),
- $(''+$(inputEl).data('fieldIsPublic')+':').attr({ 'class': 'ispublic-label' }) ,
- $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload),
- $(' ').attr({ 'href': "#", 'class': 'remove-upload' }).click(function(){
- if(confirm($(inputEl).data('areYouSure'))){
+ $('', {
+ 'type': 'text',
+ 'class': 'filename readonly',
+ 'name': 'attachments[' + attachmentId + '][filename]',
+ 'readonly': 'readonly'
+ }).val(file.name),
+ $('', {
+ 'type': 'text',
+ 'class': 'description',
+ 'name': 'attachments[' + attachmentId + '][description]',
+ 'maxlength': 254,
+ 'placeholder': $(inputEl).data('descriptionPlaceholder')
+ }).toggle(!eagerUpload),
+ $('' + $(inputEl).data('fieldIsPublic') + ':').attr({
+ 'class': 'ispublic-label'
+ }),
+ $('', {
+ 'type': 'checkbox',
+ 'class': 'is_public_checkbox',
+ 'value': 1,
+ 'name': 'attachments[' + attachmentId + '][is_public_checkbox]',
+ checked: 'checked'
+ }).toggle(!eagerUpload),
+ $(' ').attr({
+ 'href': "#",
+ 'class': 'remove-upload'
+ }).click(function() {
+ if (confirm($(inputEl).data('areYouSure'))) {
removeFile();
- if(!eagerUpload){
- (function(e){
+ if (!eagerUpload) {
+ (function(e) {
reload(e);
})(fileSpan);
}
}
}).toggle(!eagerUpload),
- $('', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} )
+ $('
', {
+ 'class': 'div_attachments',
+ 'name': 'div_' + 'attachments_' + attachmentId
+ })
).appendTo('#attachments_fields');
- if(eagerUpload) {
+ if (eagerUpload) {
ajaxUpload(file, attachmentId, fileSpan, inputEl);
}
@@ -106,8 +163,8 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
}
function onProgress(e) {
- if(e.lengthComputable) {
- this.progressbar( 'value', e.loaded * 100 / e.total );
+ if (e.lengthComputable) {
+ this.progressbar('value', e.loaded * 100 / e.total);
}
}
@@ -116,18 +173,17 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
ajaxUpload.uploading++;
uploadBlob(file, $(inputEl).data('upload-path'), attachmentId, {
- loadstartEventHandler: onLoadstart.bind(progressSpan),
- progressEventHandler: onProgress.bind(progressSpan)
- })
+ loadstartEventHandler: onLoadstart.bind(progressSpan),
+ progressEventHandler: onProgress.bind(progressSpan)
+ })
.done(function(result) {
- progressSpan.progressbar( 'value', 100 ).remove();
+ progressSpan.progressbar('value', 100).remove();
fileSpan.find('input.description, a').css('display', 'inline-block');
fileSpan.find('input.is_public_checkbox, a').css('display', 'inline-block');
})
.fail(function(result) {
progressSpan.text(result.statusText);
- if($("#network_issue"))
- {
+ if ($("#network_issue")) {
$("#network_issue").show();
}
}).always(function() {
@@ -143,33 +199,37 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
//gcm files count and add delete_all link
//modify by yutao 2015-5-14 1ҳڶϴؼʱ˿bug ʸ֮ start
- var containerid=$(inputEl).data('containerid');
- if(containerid==undefined){
- var count=$('#attachments_fields>span').length;
- $('#upload_file_count').html("
"+count+""+$(inputEl).data('fileCount'));
- if(count>=1){
- var add_attachs=$('.add_attachment');
- var delete_all=$('.remove_all');
- if(delete_all.length<1){
- add_attachs.append($("
 ").attr({"href":"javascript:void(0)", 'class': 'remove_all',"onclick": "removeAll()"}));
+ var containerid = $(inputEl).data('containerid');
+ if (containerid == undefined) {
+ var count = $('#attachments_fields>span').length;
+ $('#upload_file_count').html("
" + count + "" + $(inputEl).data('fileCount'));
+ if (count >= 1) {
+ var add_attachs = $('.add_attachment');
+ var delete_all = $('.remove_all');
+ if (delete_all.length < 1) {
+ add_attachs.append($("
 ").attr({
+ "href": "javascript:void(0)",
+ 'class': 'remove_all',
+ "onclick": "removeAll()"
+ }));
}
}
- }else{
- var count=$('#attachments_fields'+containerid+'>span').length;
- $('#upload_file_count'+containerid).html("
"+count+""+$(inputEl).data('fileCount'));
- if(count>=1){
- var add_attachs=$('.add_attachment').filter(function(index){
- return $(this).data('containerid')==containerid;
+ } else {
+ var count = $('#attachments_fields' + containerid + '>span').length;
+ $('#upload_file_count' + containerid).html("
" + count + "" + $(inputEl).data('fileCount'));
+ if (count >= 1) {
+ var add_attachs = $('.add_attachment').filter(function(index) {
+ return $(this).data('containerid') == containerid;
});
- var delete_all=$('.remove_all').filter(function(index){
- return $(this).data('containerid')==containerid;
+ var delete_all = $('.remove_all').filter(function(index) {
+ return $(this).data('containerid') == containerid;
});
- if(delete_all.length<1){
+ if (delete_all.length < 1) {
add_attachs.append($("
 ").attr({
- "href":"javascript:void(0)",
+ "href": "javascript:void(0)",
'class': 'remove_all',
'data-containerid': containerid,
- "onclick": "removeAll('"+containerid+"')"
+ "onclick": "removeAll('" + containerid + "')"
}));
}
}
@@ -186,7 +246,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
var maxSyncUpload = $(inputEl).data('max-concurrent-uploads');
- if(maxSyncUpload == null || maxSyncUpload <= 0 || ajaxUpload.uploading < maxSyncUpload)
+ if (maxSyncUpload == null || maxSyncUpload <= 0 || ajaxUpload.uploading < maxSyncUpload)
actualUpload(file, attachmentId, fileSpan, inputEl);
else
$(inputEl).parents('form').queue('upload', actualUpload.bind(this, file, attachmentId, fileSpan, inputEl));
@@ -201,23 +261,23 @@ function removeFile() {
//gcm delete all file
//modify by yutao 2015-5-14 1ҳڶϴؼʱ˿bug ʸ֮ start
-function removeAll(containerid){
- if(confirm(deleteallfiles)){
- if(containerid==undefined){
- $(".remove-upload").removeAttr("data-confirm");
- $(".remove-upload").click();
- }else{
- var arr = $(".remove-upload").filter(function(){
- return $(this).data('containerid')==containerid;
- });
- arr.removeAttr("data-confirm");
- arr.click();
+function removeAll(containerid) {
+ if (confirm(deleteallfiles)) {
+ if (containerid == undefined) {
+ $(".remove-upload").removeAttr("data-confirm");
+ $(".remove-upload").click();
+ } else {
+ var arr = $(".remove-upload").filter(function() {
+ return $(this).data('containerid') == containerid;
+ });
+ arr.removeAttr("data-confirm");
+ arr.click();
+ }
}
+ // return false;
}
-// return false;
-}
-//modify by yutao 2015-5-14 1ҳڶϴؼʱ˿bug ʸ֮ end
-//gcm
+ //modify by yutao 2015-5-14 1ҳڶϴؼʱ˿bug ʸ֮ end
+ //gcm
function uploadBlob(blob, uploadUrl, attachmentId, options) {
@@ -225,9 +285,9 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
loadstartEventHandler: $.noop,
progressEventHandler: $.noop
}, options);
- if(uploadUrl.indexOf('?') > 0){
+ if (uploadUrl.indexOf('?') > 0) {
uploadUrl = uploadUrl + '&attachment_id=' + attachmentId;
- }else{
+ } else {
uploadUrl = uploadUrl + '?attachment_id=' + attachmentId;
}
if (blob instanceof window.File) {
@@ -254,7 +314,6 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
function addInputFiles(inputEl) {
// var clearedFileInput = $(inputEl).clone().val('');
-
if (inputEl.files) {
// upload files using ajax
uploadAndAttachFiles(inputEl.files, inputEl);
@@ -263,15 +322,22 @@ function addInputFiles(inputEl) {
// browser not supporting the file API, upload on form submission
var attachmentId;
var aFilename = inputEl.value.split(/\/|\\/);
- attachmentId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false);
+ var count = $('#attachments_fields>span').length;
+ attachmentId = addFile(inputEl, {
+ name: aFilename[aFilename.length - 1]
+ }, false);
if (attachmentId) {
- $(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]'}).hide();
- $('#upload_file_count').html("
"+count+""+$(inputEl).data('fileCount'));
+ $(inputEl).attr({
+ name: 'attachments[' + attachmentId + '][file]'
+ }).hide();
+ if (count <= 0) count = 1;
+ $('#upload_file_count').html("
" + count + "" + $(inputEl).data('fileCount'));
}
}
//clearedFileInput.insertAfter('#attachments_fields');
}
+
function addInputFiles_board(inputEl, id) {
// var clearedFileInput = $(inputEl).clone().val('');
@@ -283,15 +349,20 @@ function addInputFiles_board(inputEl, id) {
// browser not supporting the file API, upload on form submission
var attachmentId;
var aFilename = inputEl.value.split(/\/|\\/);
- attachmentId = addFile_board(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false, id);
+ attachmentId = addFile_board(inputEl, {
+ name: aFilename[aFilename.length - 1]
+ }, false, id);
if (attachmentId) {
- $(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]'}).hide();
- $('#upload_file_count').html("
"+count+""+$(inputEl).data('fileCount'));
+ $(inputEl).attr({
+ name: 'attachments[' + attachmentId + '][file]'
+ }).hide();
+ $('#upload_file_count').html("
" + count + "" + $(inputEl).data('fileCount'));
}
}
//clearedFileInput.insertAfter('#attachments_fields');
}
+
function uploadAndAttachFiles(files, inputEl) {
var maxFileSize = $(inputEl).data('max-file-size');
@@ -299,14 +370,19 @@ function uploadAndAttachFiles(files, inputEl) {
var sizeExceeded = false;
$.each(files, function() {
- if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {sizeExceeded=true;}
+ if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {
+ sizeExceeded = true;
+ }
});
if (sizeExceeded) {
window.alert(maxFileSizeExceeded);
} else {
- $.each(files, function() {addFile(inputEl, this, true);});
+ $.each(files, function() {
+ addFile(inputEl, this, true);
+ });
}
}
+
function uploadAndAttachFiles_board(files, inputEl, id) {
var maxFileSize = $(inputEl).data('max-file-size');
@@ -314,14 +390,19 @@ function uploadAndAttachFiles_board(files, inputEl, id) {
var sizeExceeded = false;
$.each(files, function() {
- if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {sizeExceeded=true;}
+ if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {
+ sizeExceeded = true;
+ }
});
if (sizeExceeded) {
window.alert(maxFileSizeExceeded);
} else {
- $.each(files, function() {addFile_board(inputEl, this, true, id);});
+ $.each(files, function() {
+ addFile_board(inputEl, this, true, id);
+ });
}
}
+
function handleFileDropEvent(e) {
$(this).removeClass('fileover');
@@ -345,7 +426,9 @@ function dragOutHandler(e) {
function setupFileDrop() {
if (window.File && window.FileList && window.ProgressEvent && window.FormData) {
- $.event.fixHooks.drop = { props: [ 'dataTransfer' ] };
+ $.event.fixHooks.drop = {
+ props: ['dataTransfer']
+ };
$('form div.box').has('input:file').each(function() {
$(this).on({
@@ -358,18 +441,18 @@ function setupFileDrop() {
}
$(document).ready(setupFileDrop);
-$(function(){
+$(function() {
$(".file_selector").each(function() {
deleteallfiles = $(this).data('deleteAllFiles');
var containerid = $(this).data('containerid');
- if (containerid == undefined)containerid = '';
+ if (containerid == undefined) containerid = '';
var count = $('#attachments_fields' + containerid + '>span').length;
if (count >= 1) {
$('#upload_file_count' + containerid).html("
" + count + "" + $(this).data('fileCount'));
- var add_attachs = $('.add_attachment').filter(function (index) {
+ var add_attachs = $('.add_attachment').filter(function(index) {
return $(this).data('containerid') == containerid;
});
- var delete_all = $('.remove_all').filter(function (index) {
+ var delete_all = $('.remove_all').filter(function(index) {
return $(this).data('containerid') == containerid;
});
if (delete_all.length < 1) {
@@ -383,4 +466,4 @@ $(function(){
}
});
-});
\ No newline at end of file
+});
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 769136f2d..b2e68085a 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -635,6 +635,8 @@ a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
.mr18{ margin-right:18px;}
a.hwork_center{ display:block; width:60px; margin-right:5px;overflow: hidden; white-space: nowrap; text-overflow:ellipsis;}
.hwork_name{ display:block;width:80px; overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;}
+.absence_penalty{ display:block;width:45px; overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;}
+.border_ce {border: 1px solid #e4e4e4;}
.show_hwork{ border:2px solid #64bdd9; width:646px; padding:10px; color:#666666; padding-bottom:0px; }
.show_hwork ul li{ margin-bottom:5px;}
.show_hwork_arrow{ position:relative; top:2px; left:25px;background:url(../images/course/arrow_up.jpg) 0 0 no-repeat; width:20px; height:11px;}
@@ -657,7 +659,9 @@ a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;}
.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;}
/*返回顶部*/
.to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;}
-
+.hwork_num_ab{ width:120px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;}
+.hwork_name_ab{ display:block;width:340px; overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;}
+.absence{width: 50px;text-align: center;}
/* 评分插件 */
input#score{ width:40px;}
.ui-slider{position:relative;width:200px;float:left;margin-right:10px;height:14px; margin-top:2px;background:#e2e2e2; }
@@ -666,7 +670,7 @@ input#score{ width:40px;}
.ui-slider .ui-slider-handle:active{background-image:none;}
.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;top:0;height:100%;background:#64bdd9;left:0;}
-.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;}
+.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;}
.student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; }
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 0ed497127..cdcde2559 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -69,6 +69,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.ml90{ margin-left:90px;}
.ml100{ margin-left:100px;}
.ml110{ margin-left:110px;}
+.ml320{ margin-left:320px;}
.mr5{ margin-right:5px;}
.mr10{ margin-right:10px;}
.mr20{ margin-right:20px;}