From 2e561de52500f7e1ddddea2d757d2e15a604c42f Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Fri, 31 Jul 2015 16:32:55 +0800
Subject: [PATCH 001/110] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=86=85=E9=83=A8?=
=?UTF-8?q?=E7=9A=84=E7=BC=96=E5=8F=B7#2264=E4=B9=9F=E5=8F=AF=E4=BB=A5?=
=?UTF-8?q?=E6=94=B9=E4=B8=BA=EF=BC=9A=E5=85=B6=E5=AE=9E=E9=99=85=E7=9A=84?=
=?UTF-8?q?id?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/issues/show.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 8c12d62e0..b72558de4 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -2,11 +2,11 @@
<%= l(:label_issue_edit) %>
-<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.subject}" %>
+<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.id}" %>
<%= link_to "#{@issue.project.name}"+">", project_issues_path(@issue.project) %>
-
<%= "#" + @issue.project_index %>
+
<%= "#" + @issue.id.to_s %>
From 600f5de32e28bbe7d6c6d6748db8dd3cef7faba1 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Thu, 21 Jan 2016 16:11:06 +0800
Subject: [PATCH 002/110] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E8=BF=9B=E5=85=A5=E4=B8=AA=E4=BA=BA=E5=8D=9A=E5=AE=A2=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=E5=90=8E=EF=BC=8C=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=AA?=
=?UTF-8?q?=E4=BA=BA=E9=A6=96=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/blog_comments_controller.rb | 10 +++++++---
app/views/blog_comments/edit.html.erb | 2 +-
app/views/blog_comments/show.html.erb | 2 +-
app/views/users/_user_blog.html.erb | 2 +-
public/stylesheets/new_user.css | 2 +-
5 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb
index ae6aff794..df6ba10d2 100644
--- a/app/controllers/blog_comments_controller.rb
+++ b/app/controllers/blog_comments_controller.rb
@@ -52,10 +52,14 @@ class BlogCommentsController < ApplicationController
render_attachment_warning_if_needed(@article)
else
end
- if params[:is_homepage]
- redirect_to user_blogs_path(params[:user_id])
+ if params[:in_act]
+ redirect_to user_path(params[:user_id])
else
- redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id])
+ if params[:is_homepage]
+ redirect_to user_blogs_path(params[:user_id])
+ else
+ redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id])
+ end
end
end
def destroy
diff --git a/app/views/blog_comments/edit.html.erb b/app/views/blog_comments/edit.html.erb
index 43a8aae92..704342fc0 100644
--- a/app/views/blog_comments/edit.html.erb
+++ b/app/views/blog_comments/edit.html.erb
@@ -1,5 +1,5 @@
<% if User.current.logged? && User.current.id == @user.id %>
- <%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage]},:method=>'PUT',
+ <%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
<% end %>
diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb
index 6f4397569..ce8f52f25 100644
--- a/app/views/blog_comments/show.html.erb
+++ b/app/views/blog_comments/show.html.erb
@@ -45,7 +45,7 @@
<%= link_to(
l(:button_edit),
- {:action => 'edit', :id => @article.id},
+ {:action => 'edit', :id => @article.id,:in_act => params[:in_act]},
:class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %>
diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb
index 581bfb53c..7658bc581 100644
--- a/app/views/users/_user_blog.html.erb
+++ b/app/views/users/_user_blog.html.erb
@@ -15,7 +15,7 @@
- <%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id), :class => "postGrey" %>
+ <%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:in_act => true), :class => "postGrey" %>
<% if activity.sticky == 1%>
置顶
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index b1f950960..ee0c08a14 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -693,7 +693,7 @@ a.postReplyCancel:hover {color:#ffffff;}
.homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;}
.homepagePostSettiongText {width:85px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;}
.homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;}
-a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;}
+a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;text-align:center;}
a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyPortrait {float:left; width:33px;}
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
From b6460633d22145132bae3df0e9259c330ad20d6c Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Thu, 21 Jan 2016 16:15:45 +0800
Subject: [PATCH 003/110] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8D=9A=E5=AE=A2?=
=?UTF-8?q?=E6=8C=89=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E5=80=92=E6=8E=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/blogs_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb
index 0202224ed..42e70bcf0 100644
--- a/app/controllers/blogs_controller.rb
+++ b/app/controllers/blogs_controller.rb
@@ -2,7 +2,7 @@ class BlogsController < ApplicationController
before_filter :find_blog,:except => [:index,:create,:new,:set_homepage, :cancel_homepage]
before_filter :find_user
def index
- @articls = @user.blog.articles
+ @articls = @user.blog.articles.order("updated on desc")
@article = BlogComment.new
respond_to do |format|
format.html {render :layout=>'new_base_user'}
From 594ce8a3040ec34bcdb2ca7849865bfb59ac7ef0 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Thu, 21 Jan 2016 16:57:13 +0800
Subject: [PATCH 004/110] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=A0=E4=B8=AAbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 21 ++++++++++++++-----
app/views/news/_project_news.html.erb | 2 +-
app/views/news/_project_news_new.html.erb | 2 +-
app/views/news/_project_show.html.erb | 2 +-
app/views/news/edit.html.erb | 2 +-
.../organizations/_org_subfield_news.html.erb | 16 +++++++++++++-
app/views/users/_course_news.html.erb | 16 +++++++++++++-
app/views/users/_project_news.html.erb | 20 +++++++++++++++---
8 files changed, 67 insertions(+), 14 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index b1c384ae4..38d148907 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1791,13 +1791,24 @@ class UsersController < ApplicationController
def share_news_to_project
news = News.find(params[:send_id])
project_ids = params[:project_ids]
+ # project_ids.each do |project_id|
+ # if Project.find(project_id).news.map(&:id).exclude?(news.id)
+ # project_news = News.create(:project_id => project_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now)
+ # news.attachments.each do |attach|
+ # project_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ # :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ # :is_public => attach.is_public, :quotes => 0)
+ # end
+ # end
+ # end
project_ids.each do |project_id|
- if Project.find(project_id).news.map(&:id).exclude?(news.id)
- project_news = News.create(:project_id => project_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now)
+ project = Project.find(project_id)
+ if project.news.map(&:id).exclude?(news.id)
+ message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id)
news.attachments.each do |attach|
- project_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
- :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
- :is_public => attach.is_public, :quotes => 0)
+ message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
end
end
end
diff --git a/app/views/news/_project_news.html.erb b/app/views/news/_project_news.html.erb
index fa2a99cd7..1b4c51cd0 100644
--- a/app/views/news/_project_news.html.erb
+++ b/app/views/news/_project_news.html.erb
@@ -23,7 +23,7 @@
+
\ No newline at end of file
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb
index b7cc1a0c2..3028f3369 100644
--- a/app/views/memos/show.html.erb
+++ b/app/views/memos/show.html.erb
@@ -74,7 +74,7 @@
<%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
<%= format_date( @memo.created_at)%>
-
+
<%= @memo.content.html_safe%>
@@ -136,4 +136,11 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb
index c760e686d..66d4bd0d0 100644
--- a/app/views/messages/_course_show.html.erb
+++ b/app/views/messages/_course_show.html.erb
@@ -80,7 +80,7 @@
<%= format_time( @topic.created_on)%>
-
+
<%= @topic.content.html_safe%>
@@ -168,4 +168,11 @@
<% end %>
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb
index 6d12fe960..f46e7d5ab 100644
--- a/app/views/messages/_org_subfield_show.html.erb
+++ b/app/views/messages/_org_subfield_show.html.erb
@@ -109,7 +109,7 @@
<%= format_time( @topic.created_on)%>
-
+
<%= @topic.content.html_safe%>
@@ -197,4 +197,11 @@
<% end %>
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb
index c98f2983e..187e1670e 100644
--- a/app/views/messages/_project_show.html.erb
+++ b/app/views/messages/_project_show.html.erb
@@ -135,7 +135,7 @@
<%= format_time( @topic.created_on)%>
-
+
<%= @topic.content.html_safe%>
@@ -225,3 +225,10 @@
+
diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb
index 767c11553..05a430d57 100644
--- a/app/views/news/_course_show.html.erb
+++ b/app/views/news/_course_show.html.erb
@@ -85,7 +85,7 @@
<%= format_time( @news.created_on)%>
-
+
<%= @news.description.html_safe%>
@@ -182,3 +182,10 @@
<% end %>
+
diff --git a/app/views/news/_organization_show.html.erb b/app/views/news/_organization_show.html.erb
index 3e608c177..3189b03bf 100644
--- a/app/views/news/_organization_show.html.erb
+++ b/app/views/news/_organization_show.html.erb
@@ -75,7 +75,7 @@
<%= format_time( @news.created_on)%>
-
+
<%= @news.description.html_safe%>
@@ -172,3 +172,10 @@
<% end %>
+
diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb
index 880bd0885..93fd1f10c 100644
--- a/app/views/news/_project_show.html.erb
+++ b/app/views/news/_project_show.html.erb
@@ -85,7 +85,7 @@
<%= format_time( @news.created_on)%>
-
+
<%= @news.description.html_safe%>
@@ -182,3 +182,10 @@
<% end %>
+
diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb
index d4b44a3d2..b29bac7d1 100644
--- a/app/views/organizations/_show_org_document.html.erb
+++ b/app/views/organizations/_show_org_document.html.erb
@@ -20,10 +20,12 @@
<% unless document.content.blank? %>
-
- <%= document.content.html_safe %>
-
+ <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %>
<% end %>
+
+
+
+
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
@@ -133,9 +135,6 @@
From 26f850067125f4302c0c2cdf5a1bd794129bc61e Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Fri, 22 Jan 2016 18:42:50 +0800
Subject: [PATCH 015/110] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E5=9B=9E=E5=A4=8D?=
=?UTF-8?q?=E5=90=8E=EF=BC=8C=E8=AF=A5=E5=8D=9A=E5=AE=A2=E7=9A=84=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E6=97=B6=E9=97=B4=E4=B8=BA=E5=BD=93=E5=89=8D=E6=97=B6?=
=?UTF-8?q?=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/blog_comments_controller.rb | 1 +
app/models/blog_comment.rb | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb
index df6ba10d2..87bbcb2f3 100644
--- a/app/controllers/blog_comments_controller.rb
+++ b/app/controllers/blog_comments_controller.rb
@@ -127,6 +127,7 @@ class BlogCommentsController < ApplicationController
@blogComment.title = "RE: #{@article.title}" unless params[:blog_comment][:title]
@article.children << @blogComment
@article.save
+ # @article.update_attribute(:updated_on, @blogComment.updated_on)
@user_activity_id = params[:user_activity_id]
user_activity = UserActivity.where("act_type='BlogComment' and act_id =#{@article.id}").first
if user_activity
diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb
index db28e55d6..2b31af604 100644
--- a/app/models/blog_comment.rb
+++ b/app/models/blog_comment.rb
@@ -18,6 +18,7 @@ class BlogComment < ActiveRecord::Base
after_save :add_user_activity
after_update :update_activity
+ after_create :update_parent_time
before_destroy :destroy_user_activity
scope :like, lambda {|arg|
@@ -64,6 +65,11 @@ class BlogComment < ActiveRecord::Base
(user && user.logged? && (self.author == user) ) || user.admin?
end
+ def update_parent_time
+ if !self.parent.nil?
+ self.root.update_attribute(:updated_on, self.updated_on)
+ end
+ end
def project
end
end
From 16cb4add09365267eb0eefebd59fd9b5ae287e4e Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 22 Jan 2016 18:48:40 +0800
Subject: [PATCH 016/110] =?UTF-8?q?issue=E5=B1=80=E9=83=A8=E5=88=B7?=
=?UTF-8?q?=E6=96=B0=E5=B1=9E=E6=80=A7=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/issues_controller.rb | 4 ++--
app/views/users/_project_issue.html.erb | 2 ++
app/views/users/_project_issue_detail.html.erb | 8 ++++----
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 72dd0a741..eb78c4c5b 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -81,7 +81,7 @@ class IssuesController < ApplicationController
@priority_id = params[:priority_id]
@status_id = params[:status_id]
@subject = params[:subject]
- @done_ratio = parmas[:done_ratio]
+ @done_ratio = params[:done_ratio]
@issue_count = @query.issue_count
@issue_pages = Paginator.new @issue_count, @limit, params['page']
params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
@@ -222,7 +222,7 @@ class IssuesController < ApplicationController
def update
if params[:issue_detail]
- issue = Issue.find(params[:issue_id])
+ issue = Issue.find(params[:id])
issue = update_user_issue_detail(issue, params)
@saved = update_user_issue_detail(issue, params)
return
diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb
index 618dc3185..725a064cc 100644
--- a/app/views/users/_project_issue.html.erb
+++ b/app/views/users/_project_issue.html.erb
@@ -52,9 +52,11 @@
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<%# 局部刷新:修改xissue属性 %>
+ <% unless params[:action] == "index" %>
<%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
+ <% end %>
diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb
index e46761bd1..b682a74ea 100644
--- a/app/views/users/_project_issue_detail.html.erb
+++ b/app/views/users/_project_issue_detail.html.erb
@@ -42,7 +42,7 @@
{:include_blank => false, :selected => @status_id ? @status_id : 0 },
{:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %>
<%# end %>
- <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %>
+ <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %>
状态 :
<%= activity.status.name %>
@@ -54,7 +54,7 @@
<% end %>
- <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
+ <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
指派 :
@@ -68,7 +68,7 @@
- <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
+ <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
优先级 :
<%= activity.priority.name %>
@@ -78,7 +78,7 @@
<% end %>
- <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
+ <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
完成度 :
<%= activity.done_ratio %>%
From c4a264f8a6864f5487d7d63945b3fa11dd7ddd98 Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 22 Jan 2016 18:48:50 +0800
Subject: [PATCH 017/110] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81?=
=?UTF-8?q?=E6=97=B6=E7=9A=84=E9=99=84=E4=BB=B6=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/_work_edit_information.html.erb | 10 +++++++++-
app/views/student_work/_work_information.html.erb | 10 +++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/app/views/student_work/_work_edit_information.html.erb b/app/views/student_work/_work_edit_information.html.erb
index 38670d9e4..1934d15eb 100644
--- a/app/views/student_work/_work_edit_information.html.erb
+++ b/app/views/student_work/_work_edit_information.html.erb
@@ -13,7 +13,15 @@
<%= "无附件"%>
<% else %>
- <%= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
+ <% @student_work.attachments.each_with_index do |attachment,i| %>
+
+ <%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%>
+ <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) %>
+
(<%= number_to_human_size attachment.filesize %>)
+
+
+ <% end -%>
+ <%#= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
<% end %>
diff --git a/app/views/student_work/_work_information.html.erb b/app/views/student_work/_work_information.html.erb
index bc728ca71..d23f21c4d 100644
--- a/app/views/student_work/_work_information.html.erb
+++ b/app/views/student_work/_work_information.html.erb
@@ -13,7 +13,15 @@
<%= "无附件"%>
<% else %>
- <%= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
+ <% @student_work.attachments.each_with_index do |attachment,i| %>
+
+ <%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%>
+ <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) %>
+
(<%= number_to_human_size attachment.filesize %>)
+
+
+ <% end -%>
+ <%#= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
<% end %>
From 007afa8c4f991471d7f6bd84f80bb78fc4c54f29 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 22 Jan 2016 19:34:02 +0800
Subject: [PATCH 018/110] =?UTF-8?q?issue=E5=9C=A8=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E4=B8=AD=E5=9B=9E=E5=A4=8D=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/issues/add_journal.js.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb
index 5708f6b3d..9099c31b6 100644
--- a/app/views/issues/add_journal.js.erb
+++ b/app/views/issues/add_journal.js.erb
@@ -20,7 +20,7 @@
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)')
sd_create_editor_from_data(<%= @issue.id %>, null, "100%");
<%else%>
- $("#div_user_issue_reply_<%=@user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>");
+ $("#div_user_issue_reply_<%=@user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>");
init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity');
// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%");
<%end %>
From afad062b809ee80c7592973a0274e508b854a715 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Fri, 22 Jan 2016 19:49:05 +0800
Subject: [PATCH 019/110] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E6=A0=8F=E7=9B=AE=E3=80=81=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E3=80=81=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90=E7=9A=84title,?=
=?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BAFiles?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/files/_course_file.html.erb | 2 +-
app/views/files/_project_file.html.erb | 2 +-
app/views/files/_subfield_files.html.erb | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb
index 85b230be3..cf91b7814 100644
--- a/app/views/files/_course_file.html.erb
+++ b/app/views/files/_course_file.html.erb
@@ -126,4 +126,4 @@
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
-<% html_title(l(:label_attachment_plural)) -%>
\ No newline at end of file
+<%# html_title(l(:label_attachment_plural)) -%>
\ No newline at end of file
diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb
index 88c30e1b7..e8f4f023b 100644
--- a/app/views/files/_project_file.html.erb
+++ b/app/views/files/_project_file.html.erb
@@ -95,4 +95,4 @@
<%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %>
-<% html_title(l(:label_attachment_plural)) -%>
\ No newline at end of file
+<%# html_title(l(:label_attachment_plural)) -%>
\ No newline at end of file
diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb
index eed9266d5..1de0e8dc2 100644
--- a/app/views/files/_subfield_files.html.erb
+++ b/app/views/files/_subfield_files.html.erb
@@ -74,7 +74,7 @@
-<% html_title(l(:label_attachment_plural)) -%>
+<%# html_title(l(:label_attachment_plural)) -%>
- <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id} %>
+ <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>false} %>
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
<% end %>
<%end%>
diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb
index ac56b69fc..8d6674845 100644
--- a/app/views/words/create_reply.js.erb
+++ b/app/views/words/create_reply.js.erb
@@ -1,9 +1,9 @@
<% if @save_succ %>
<% if @user_activity_id %>
<% if @reply_type == 'user' %>
- $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
<% else %>
- $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
<% end %>
init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity");
<% else %>
From 655cc0d2dbcaadaf95ed4dbe56d2a2bdf07a90bb Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 22 Jan 2016 20:26:44 +0800
Subject: [PATCH 022/110] =?UTF-8?q?issue=E6=88=AA=E6=AD=A2=E6=97=B6?=
=?UTF-8?q?=E9=97=B4=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/mailer.rb | 10 +++++++++-
app/views/mailer/issue_due_date.text.erb | 0
lib/tasks/issue_due_date.rake | 4 ++--
3 files changed, 11 insertions(+), 3 deletions(-)
create mode 100644 app/views/mailer/issue_due_date.text.erb
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index ee37927d3..05b0349ec 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -380,7 +380,15 @@ class Mailer < ActionMailer::Base
end
# issue截止时间提醒
- def issue_due_date(issue, recipients)
+ def issue_due_date(issue)
+ recipients ||= []
+ if issue.author.id != issue.assigned_to_id
+ recipients << issue.author.mail
+ end
+
+ # 被指派人邮箱地址加入数组
+ recipients << issue.assigned_to.mail
+ # cc = wiki_content.page.wiki.watcher_recipients - recipients
@author = issue.author
@issue_name = issue.subject
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id)
diff --git a/app/views/mailer/issue_due_date.text.erb b/app/views/mailer/issue_due_date.text.erb
new file mode 100644
index 000000000..e69de29bb
diff --git a/lib/tasks/issue_due_date.rake b/lib/tasks/issue_due_date.rake
index 74ee242f5..8ea6d9ed0 100644
--- a/lib/tasks/issue_due_date.rake
+++ b/lib/tasks/issue_due_date.rake
@@ -14,10 +14,10 @@ namespace :issue_due_date do
recipients << assigner
recipients.each do |r|
issue.forge_messages << ForgeMessage.new(:user_id => r.id, :project_id => issue.project_id, :viewed => false, :status => 1)
- # issue截止时间邮件提醒
- Mailer.issue_due_date(issue, recipients).deliver
end
end
+ # issue截止时间邮件提醒
+ Mailer.issue_due_date(issue).deliver
end
end
end
From b3caa0154057d053d24924a84de988a1f55c689a Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 22 Jan 2016 20:45:25 +0800
Subject: [PATCH 023/110] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=93=BE=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/courses/_recommendation.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb
index 455ced056..d0afc6ebd 100644
--- a/app/views/courses/_recommendation.html.erb
+++ b/app/views/courses/_recommendation.html.erb
@@ -7,7 +7,7 @@
<%=link_to e_course.name, course_path(e_course.id), :class => "hidden fl w170" %>
<%= l(:project_module_attachments) %>(<%= link_to e_course.attachments.count, course_files_path(e_course), :class => "linkBlue2" %>)
- <%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.count, homework_common_index_path(e_course), :class => "linkBlue2" %>)
+ <%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.count, homework_common_index_path(:course=>e_course.id), :class => "linkBlue2" %>)
From bbdced9bc11b04ef06143675c3a400a4429fb9ea Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 22 Jan 2016 21:41:17 +0800
Subject: [PATCH 024/110] =?UTF-8?q?=E7=95=99=E8=A8=80=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_jour_form.html.erb | 4 ++--
app/views/users/_user_activities.html.erb | 2 +-
app/views/users/_user_journalsformessage.html.erb | 2 +-
app/views/users/_user_jours_list.html.erb | 2 +-
app/views/words/create_reply.js.erb | 2 +-
db/schema.rb | 1 +
6 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/app/views/users/_jour_form.html.erb b/app/views/users/_jour_form.html.erb
index 13bf6d79a..4ad9fef54 100644
--- a/app/views/users/_jour_form.html.erb
+++ b/app/views/users/_jour_form.html.erb
@@ -8,8 +8,8 @@
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor :content, :editor_id => 'jour_content_editor',
:width => '99.7%',
- :height => 40,
- :minHeight=>40,
+ :height => 100,
+ :minHeight=>100,
:input_html => { :id => 'jour_content',
:class => 'talk_text fl',
:maxlength => 5000 }%>
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index d4169bc47..c8d599af4 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -111,7 +111,7 @@
<% case user_activity.act_type.to_s %>
<% when 'JournalsForMessage' %>
<% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %>
- <%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>true} %>
+ <%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>1} %>
<% end %>
<% end %>
<% end %>
diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb
index 70cce2374..e30fd1824 100644
--- a/app/views/users/_user_journalsformessage.html.erb
+++ b/app/views/users/_user_journalsformessage.html.erb
@@ -16,7 +16,7 @@
<% end %>
<% end %>
- <% if is_activity %>
+ <% if is_activity.to_i == 1 %>
<% if activity.parent %>
<%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
diff --git a/app/views/users/_user_jours_list.html.erb b/app/views/users/_user_jours_list.html.erb
index 6993a7e91..c73344a7a 100644
--- a/app/views/users/_user_jours_list.html.erb
+++ b/app/views/users/_user_jours_list.html.erb
@@ -22,7 +22,7 @@
init_activity_KindEditor_data(<%= jour.id%>, null, "87%", "<%=jour.class.to_s%>");
});
- <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>false} %>
+ <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>0} %>
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
<% end %>
<%end%>
diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb
index 8d6674845..d4d9a2cd7 100644
--- a/app/views/words/create_reply.js.erb
+++ b/app/views/words/create_reply.js.erb
@@ -3,7 +3,7 @@
<% if @reply_type == 'user' %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
<% else %>
- $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
<% end %>
init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity");
<% else %>
diff --git a/db/schema.rb b/db/schema.rb
index fb021e9ae..b31ebc5c2 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1371,6 +1371,7 @@ ActiveRecord::Schema.define(:version => 20160122094829) do
t.integer "changeset_num", :default => 0
t.integer "board_message_num", :default => 0
t.integer "board_num", :default => 0
+ t.integer "act_num", :default => 0
t.integer "attach_num", :default => 0
t.datetime "commit_time"
end
From 4b253835313fd02367d4394d373bf24153beb03b Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 22 Jan 2016 21:42:05 +0800
Subject: [PATCH 025/110] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E7=9A=84tip=E8=A2=AB=E9=81=AE=E7=9B=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/courses.css | 2 +-
public/stylesheets/project.css | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 1e3c68c83..a0052b97a 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -513,7 +513,7 @@ a.exit { height:24px; display:block; width:80px; color:#000000; background:#c3c3
.st_list{ width:670px;}
.st_search{ }
.st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;}
-.st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:200px; padding-left:5px; margin-bottom:5px;}
+.st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:220px; padding-left:5px; margin-bottom:5px;}
.st_search a{ background:#1c9ec7; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:60px; height:20px; float:left; font-size:12px; }
.st_search a:hover{ background:#048fbb; text-decoration:none;}
.classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index f1b0c5846..29c099d3d 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -414,7 +414,7 @@ a.link_file_board{ background:url(../images/pic_file.png) 0 3px no-repeat !impor
.st_list{ width:670px;}
.st_search{ }
.st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;}
-.st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:200px; padding-left:5px; margin-bottom:5px;}
+.st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:220px; padding-left:5px; margin-bottom:5px;}
.st_search a{ background:#1c9ec7; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:60px; height:20px; float:left; font-size:12px; }
.st_search a:hover{ background:#048fbb; text-decoration:none;}
.classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
@@ -1167,4 +1167,4 @@ div.disable_link {background-color: #c1c1c1 !important;}
/*问题跟踪局部修改属性*/
.proInfoBox2{ border:1px solid #dddddd; height:45px; padding:10px 0; background-color:#f1f1f1;}
-.proInfoBox2 ul li{ height:24px; position:relative;}
+.proInfoBox2 ul li{ height:24px; position:relative;}
From 435f81a42203969edf90807e9d0bb6cb148457e3 Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 22 Jan 2016 21:47:59 +0800
Subject: [PATCH 026/110] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E7=9A=84=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/organizations/_org_course_homework.html.erb | 2 +-
app/views/users/_course_homework.html.erb | 2 +-
app/views/users/_user_homework_detail.html.erb | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb
index 3446a86d4..3dccdcc2b 100644
--- a/app/views/organizations/_org_course_homework.html.erb
+++ b/app/views/organizations/_org_course_homework.html.erb
@@ -194,7 +194,7 @@
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<%=(User.find project.user_id).show_name %> (组长)
- <%=time_from_now !com_time.nil? && format_time(com_time) > format_timetime ? com_time : time %> <%= project.project_score.changeset_num %>提交
+ <%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %> <%= project.project_score.changeset_num %>提交
项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index 5be1334c3..23a469188 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -193,7 +193,7 @@
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<%=(User.find project.user_id).show_name %> (组长)
-
<%=time_from_now !com_time.nil? && format_time(com_time) > format_timetime ? com_time : time %> <%= project.project_score.changeset_num %>提交
+
<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %> <%= project.project_score.changeset_num %>提交
项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb
index 04c8b8f0a..36b2be34f 100644
--- a/app/views/users/_user_homework_detail.html.erb
+++ b/app/views/users/_user_homework_detail.html.erb
@@ -195,7 +195,7 @@
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<%=(User.find project.user_id).show_name %> (组长)
-
<%=time_from_now !com_time.nil? && format_time(com_time) > format_timetime ? com_time : time %> <%= project.project_score.changeset_num %>提交
+
<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %> <%= project.project_score.changeset_num %>提交
项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
From 83ff449946ed50209a466b2430cd3579dfe40287 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 22 Jan 2016 21:51:31 +0800
Subject: [PATCH 027/110] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E3=80=81=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E8=B5=84=E6=BA=90=20=E6=B5=8F=E8=A7=88=20=E6=94=B9?=
=?UTF-8?q?=E6=88=90=20=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/locales/zh.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index daa0c3a31..e9d3ed813 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -674,7 +674,7 @@ zh:
label_day_plural: 天
label_repository: 版本库
label_course_repository: 代码库
- label_browse: 浏览
+ label_browse: 上传文件
label_branch: 分支
label_tag: 标签
label_revision: 修订
From 8f1bffd28b6dc9e02fbc57521e3bedfcff778849 Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 22 Jan 2016 21:53:32 +0800
Subject: [PATCH 028/110] =?UTF-8?q?=E7=95=99=E8=A8=80=E4=B8=8D=E8=83=BD?=
=?UTF-8?q?=E4=B8=BA=E7=A9=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/javascripts/new_user.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js
index f273f0b77..b6301afad 100644
--- a/public/javascripts/new_user.js
+++ b/public/javascripts/new_user.js
@@ -75,7 +75,7 @@ function private_jour_submit(){
function jourReplyVerify() {
var content = jour_content_editor.html();//$.trim($("#message_content").val());
if (jour_content_editor.isEmpty()) {
- $("#jour_content_span").text("回复不能为空");
+ $("#jour_content_span").text("留言不能为空");
$("#jour_content_span").css('color', '#ff0000');
$("#submit_feedback_user").one('click',function() {
jour_submit();
From f632a3d4fb7b69883a9272848c3481b158bb7c08 Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 22 Jan 2016 22:17:52 +0800
Subject: [PATCH 029/110] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E5=BC=B9=E6=A1=86?=
=?UTF-8?q?=E5=9B=BA=E5=AE=9A=E4=BD=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/javascripts/homework.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js
index 0762a6db3..bd2b967e4 100644
--- a/public/javascripts/homework.js
+++ b/public/javascripts/homework.js
@@ -117,6 +117,7 @@ $(function(){
$('#BluePopupBox').parent().resizable("disable");
$('#BluePopupBox').parent().removeClass("ui-state-disabled");
$('#BluePopupBox').parent().css("border","3px solid #269ac9").css("padding","10px");
+ $('#BluePopupBox').parent().css("position","fixed");
$('a.ProBtn').live('click', function(){
$("#BluePopupBox").dialog("open");
From dfb8a3afbf1eeca98b38b0d91746a417015120ac Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 22 Jan 2016 22:35:47 +0800
Subject: [PATCH 030/110] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20160122142844_excellent_course_se.rb | 17 +++++++++++++++++
.../20160122143138_excellent_option_se.rb | 19 +++++++++++++++++++
db/schema.rb | 3 +--
3 files changed, 37 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/20160122142844_excellent_course_se.rb
create mode 100644 db/migrate/20160122143138_excellent_option_se.rb
diff --git a/db/migrate/20160122142844_excellent_course_se.rb b/db/migrate/20160122142844_excellent_course_se.rb
new file mode 100644
index 000000000..c6f5dbb88
--- /dev/null
+++ b/db/migrate/20160122142844_excellent_course_se.rb
@@ -0,0 +1,17 @@
+class ExcellentCourseSe < ActiveRecord::Migration
+ def up
+ arr = [302,192,370,394,183,361,117,218,379,178,418,203,342,403,225]
+ for i in 0..arr.length-1
+ begin
+ puts arr[i]
+ course = Course.find(arr[i])
+ course.update_attribute(:is_excellent, true)
+ rescue
+ logger.error("Course is not found!")
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160122143138_excellent_option_se.rb b/db/migrate/20160122143138_excellent_option_se.rb
new file mode 100644
index 000000000..cee739b7f
--- /dev/null
+++ b/db/migrate/20160122143138_excellent_option_se.rb
@@ -0,0 +1,19 @@
+class ExcellentOptionSe < ActiveRecord::Migration
+ def up
+ arr = [151,122,15,227,139,410,291,224,55,137,414,43,417,52,205,44,216,132,204,258,411,50,
+ 419,390,420,133,91,112,202,95,194,34,172,403,177,252,138,352,225,46,279,382,397,286,344,27,175,
+ 124,265,88,59,110,72,92,392,413,26,201,94,57,156,393,154,12,262]
+ for i in 0..arr.length-1
+ begin
+ puts arr[i]
+ course = Course.find(arr[i])
+ course.update_attribute(:excellent_option, true)
+ rescue
+ logger.error("Course is not found!")
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index b31ebc5c2..b2c74a96c 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20160122094829) do
+ActiveRecord::Schema.define(:version => 20160122143138) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -1371,7 +1371,6 @@ ActiveRecord::Schema.define(:version => 20160122094829) do
t.integer "changeset_num", :default => 0
t.integer "board_message_num", :default => 0
t.integer "board_num", :default => 0
- t.integer "act_num", :default => 0
t.integer "attach_num", :default => 0
t.datetime "commit_time"
end
From d386b2ff84194f4f5a22bc03a3d5ad5ad38e390b Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 22 Jan 2016 22:37:47 +0800
Subject: [PATCH 031/110] =?UTF-8?q?=E7=95=99=E8=A8=80=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E7=9A=84=E2=80=9C=E5=B1=95=E5=BC=80=E6=9B=B4=E5=A4=9A=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_jours_list.html.erb | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/app/views/users/_user_jours_list.html.erb b/app/views/users/_user_jours_list.html.erb
index c73344a7a..d982d8984 100644
--- a/app/views/users/_user_jours_list.html.erb
+++ b/app/views/users/_user_jours_list.html.erb
@@ -18,6 +18,22 @@
<% jours.each do |jour|%>
<% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id)) %>
-
-
-
-
- <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
-
- 优先级 :
- <%= activity.priority.name %>
- <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
- {:include_blank => false,:selected=>@priority_id ? @priority_id : 0},
- {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %>
-
- <% end %>
-
- <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
-
- 完成度 :
- <%= activity.done_ratio %>%
- <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
- {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0},
- {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %>
- <% end %>
-
-
-
-
-
-
-
- 计划完成 :
- <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
-
-
- 目标版本 :
- <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
-
-
-
+
+
+
+
+
+ <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
+
+ 优先级 :
+ <%= activity.priority.name %>
+ <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
+ {:include_blank => false,:selected=>@priority_id ? @priority_id : 0},
+ {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %>
+
+ <% end %>
+
+ <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
+
+ 完成度 :
+ <%= activity.done_ratio %>%
+ <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
+ {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0},
+ {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %>
+ <% end %>
+
+
+
+
+
+
+
+ 计划完成 :
+ <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
+
+
+ 目标版本 :
+ <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
+
+
+
\ No newline at end of file
From 1607508887a35bd7f69db590bf4f9826f34981c2 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Mon, 25 Jan 2016 14:19:39 +0800
Subject: [PATCH 037/110] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B0=86=E5=B8=96?=
=?UTF-8?q?=E5=AD=90=E5=8F=91=E9=80=81=E8=87=B3=E8=AF=BE=E7=A8=8B=E3=80=81?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9A=84=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/organizations_controller.rb | 2 +-
app/controllers/users_controller.rb | 59 +++++++++++++++----
app/views/files/index.html.erb | 14 -----
app/views/messages/_course_show.html.erb | 2 +-
.../messages/_org_subfield_show.html.erb | 1 +
app/views/messages/_project_show.html.erb | 2 +-
app/views/org_subfields/show.html.erb | 14 -----
.../_org_subfield_message.html.erb | 1 -
app/views/users/_course_message.html.erb | 4 +-
app/views/users/_project_message.html.erb | 4 +-
.../users/_share_message_to_course.html.erb | 56 ++++++++++++++++++
.../users/_share_message_to_org.html.erb | 59 +++++++++++++++++++
.../users/_share_message_to_project.html.erb | 53 +++++++++++++++++
app/views/users/search_user_course.js.erb | 4 +-
app/views/users/search_user_org.js.erb | 4 +-
app/views/users/search_user_project.js.erb | 4 +-
.../users/share_message_to_course.js.erb | 2 +
app/views/users/share_message_to_org.js.erb | 2 +
.../users/share_message_to_project.js.erb | 2 +
config/routes.rb | 3 +
20 files changed, 240 insertions(+), 52 deletions(-)
create mode 100644 app/views/users/_share_message_to_course.html.erb
create mode 100644 app/views/users/_share_message_to_org.html.erb
create mode 100644 app/views/users/_share_message_to_project.html.erb
create mode 100644 app/views/users/share_message_to_course.js.erb
create mode 100644 app/views/users/share_message_to_org.js.erb
create mode 100644 app/views/users/share_message_to_project.js.erb
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 4e3286700..514903e93 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -302,7 +302,7 @@ class OrganizationsController < ApplicationController
def org_resources_subfield
@org = Organization.find(params[:id])
- if params[:send_type].present? and params[:send_type] == 'news'
+ if params[:send_type].present? and (params[:send_type] == 'news' or params[:send_type] == 'message')
@subfield = @org.org_subfields.where("field_type = 'Post'")
else
@subfield = @org.org_subfields.where('field_type = "Resource" ')
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 38d148907..84f7d44c4 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1791,16 +1791,6 @@ class UsersController < ApplicationController
def share_news_to_project
news = News.find(params[:send_id])
project_ids = params[:project_ids]
- # project_ids.each do |project_id|
- # if Project.find(project_id).news.map(&:id).exclude?(news.id)
- # project_news = News.create(:project_id => project_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now)
- # news.attachments.each do |attach|
- # project_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
- # :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
- # :is_public => attach.is_public, :quotes => 0)
- # end
- # end
- # end
project_ids.each do |project_id|
project = Project.find(project_id)
if project.news.map(&:id).exclude?(news.id)
@@ -1826,6 +1816,53 @@ class UsersController < ApplicationController
OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'News', :org_act_id => org_news.id, :user_id => User.current.id)
end
+ def share_message_to_course
+ @message = Message.find(params[:send_id])
+ course_ids = params[:course_ids]
+ course_ids.each do |course_id|
+ course = Course.find(course_id)
+ if course.news.map(&:id).exclude?(@message.id)
+ message = Message.create(:board_id => course.boards.first.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id)
+ @message.attachments.each do |attach|
+ message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
+ end
+ end
+ end
+ end
+
+ def share_message_to_project
+ @message = Message.find(params[:send_id])
+ project_ids = params[:project_ids]
+ project_ids.each do |project_id|
+ project = Project.find(project_id)
+ if project.news.map(&:id).exclude?(@message.id)
+ message = Message.create(:board_id => project.boards.first.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id)
+ @message.attachments.each do |attach|
+ message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
+ end
+ end
+ end
+ end
+
+ def share_message_to_org
+ field_id = params[:subfield]
+ @message = Message.find(params[:send_id])
+ @message.quotes = @message.quotes.nil? ? 1 : (@message.quotes + 1)
+ @message.save
+ board = OrgSubfield.find(field_id).boards.first
+ mes = Message.create(:board_id => board.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id)
+ @message.attachments.each do |attach|
+ mes.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
+ end
+ OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'Message', :org_act_id => mes.id, :user_id => User.current.id)
+ end
+
def change_org_subfield
end
@@ -2175,7 +2212,7 @@ class UsersController < ApplicationController
@user = User.current
if !params[:search].nil? #发送到有栏目类型为资源的组织中
search = "%#{params[:search].to_s.strip.downcase}%"
- if params[:send_type].present? and params[:send_type] == 'news'
+ if params[:send_type].present? and (params[:send_type] == 'news' or params[:send_type] == 'message')
@orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Post'").count > 0}
else
@orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb
index 8cb547b13..d4d12232e 100644
--- a/app/views/files/index.html.erb
+++ b/app/views/files/index.html.erb
@@ -185,20 +185,6 @@
}
-
- function org_id_click(){
- var sendText = $("input[name='org_id']:checked").next().text();
- var orgDirection = "目标地址:"
- $(".orgDirection").text(orgDirection + sendText);
- }
- function subfield_click(){
- var sendText = $("input[name='org_id']:checked").next().text();
- var orgDirection = "目标地址:"
- var sendColumn = $("input[name='subfield']:checked").next().text();
- $(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
- }
-
-
function course_attachmenttypes_change(id, type) {
<% if @course%>
$.ajax({
diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb
index c3278a209..ce2f6e085 100644
--- a/app/views/messages/_course_show.html.erb
+++ b/app/views/messages/_course_show.html.erb
@@ -60,7 +60,7 @@
) if @message.course_destroyable_by?(User.current) %>
<% end %>
- <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
+ <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb
index 304694b39..2578b2101 100644
--- a/app/views/messages/_org_subfield_show.html.erb
+++ b/app/views/messages/_org_subfield_show.html.erb
@@ -89,6 +89,7 @@
:class => 'postOptionLink'
) if @message.org_subfield_editable_by?(User.current) %>
+ <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');",:class => 'postOptionLink'%>
diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb
index e5aba7c02..25fbc841b 100644
--- a/app/views/messages/_project_show.html.erb
+++ b/app/views/messages/_project_show.html.erb
@@ -115,7 +115,7 @@
) if @message.destroyable_by?(User.current) %>
<% end %>
- <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
+ <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %>
diff --git a/app/views/org_subfields/show.html.erb b/app/views/org_subfields/show.html.erb
index 82203b4de..7d3a2b969 100644
--- a/app/views/org_subfields/show.html.erb
+++ b/app/views/org_subfields/show.html.erb
@@ -178,20 +178,6 @@
}
-
- function org_id_click(){
- var sendText = $("input[name='org_id']:checked").next().text();
- var orgDirection = "目标地址:"
- $(".orgDirection").text(orgDirection + sendText);
- }
- function subfield_click(){
- var sendText = $("input[name='org_id']:checked").next().text();
- var orgDirection = "目标地址:"
- var sendColumn = $("input[name='subfield']:checked").next().text();
- $(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
- }
-
-
function course_attachmenttypes_change(id, type) {
<% if @course%>
$.ajax({
diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb
index 349f7c86e..16a2a55d6 100644
--- a/app/views/organizations/_org_subfield_message.html.erb
+++ b/app/views/organizations/_org_subfield_message.html.erb
@@ -13,7 +13,6 @@
<% end %>
TO
<%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",organization_path(activity.board.org_subfield.organization, :org_subfield_id => activity.board.org_subfield.id), :class => "newsBlue ml15 mr5"%>
-
<% if activity.parent_id.nil? %>
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb
index 5abd08224..8a7c6d4cd 100644
--- a/app/views/users/_course_message.html.erb
+++ b/app/views/users/_course_message.html.erb
@@ -71,9 +71,7 @@
) if activity.course_destroyable_by?(User.current) %>
<% end %>
-
- <%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %>
-
+
<%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb
index d4a7a9e60..ec36854cb 100644
--- a/app/views/users/_project_message.html.erb
+++ b/app/views/users/_project_message.html.erb
@@ -71,9 +71,7 @@
) if activity.destroyable_by?(User.current) %>
<% end %>
-
- <%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %>
-
+
<%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
diff --git a/app/views/users/_share_message_to_course.html.erb b/app/views/users/_share_message_to_course.html.erb
new file mode 100644
index 000000000..eda4a9b97
--- /dev/null
+++ b/app/views/users/_share_message_to_course.html.erb
@@ -0,0 +1,56 @@
+
+
+
+
+
发送到
+
+
+ 课程
+ 项目
+ 组织
+
+
+
+
+
+
+ <%= form_tag search_user_course_user_path(user),:method => 'get',
+ :remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+
+
+ <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
+ <% end %>
+
+ <%= form_tag share_message_to_course_user_path(user),:remote=>true,:id=>'course_list_form' %>
+
+
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+ <% if !courses.empty? %>
+ <% courses.each do |course| %>
+
+ <% end %>
+
+
+
+
+
+ <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %>
+
+
+
+
+ <% end %>
+
+
diff --git a/app/views/users/_share_message_to_org.html.erb b/app/views/users/_share_message_to_org.html.erb
new file mode 100644
index 000000000..da3c7a072
--- /dev/null
+++ b/app/views/users/_share_message_to_org.html.erb
@@ -0,0 +1,59 @@
+
+
发送到
+
+
+ 课程
+ 项目
+ 组织
+
+
+ <%= form_tag search_user_org_user_path(user),:method => 'get',
+ :remote=>true,:id=>'search_user_org_form' do %>
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+
+ <% end %>
+
+
+<%= form_tag share_message_to_org_user_path(user),:remote=>true,:id=>'orgs_list_form' do %>
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+
+
+
+
+ <%= render :partial => 'users/org_resources_subfield',:locals => {:subfield=>nil}%>
+
+
+
+
+
+
+
+
+
目标地址:
+
+ <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();',:onclick=>"check_des(event);" %>
+
+
+
+<%end %>
\ No newline at end of file
diff --git a/app/views/users/_share_message_to_project.html.erb b/app/views/users/_share_message_to_project.html.erb
new file mode 100644
index 000000000..4b79a779c
--- /dev/null
+++ b/app/views/users/_share_message_to_project.html.erb
@@ -0,0 +1,53 @@
+
+
+
发送到
+
+
+ 课程
+ 项目
+ 组织
+
+
+
+
+
+
+ <%= form_tag search_user_project_user_path(user),:method => 'get',
+ :remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %>
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+
+
+ <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
+ <% end %>
+
+ <%= form_tag share_message_to_project_user_path(user), :remote => true, :id=>'projects_list_form' %>
+
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+ <% if !projects.empty? %>
+ <% projects.each do |project| %>
+
+ <% end %>
+
+
+
+
+
+ <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %>
+
+
+
+
+ <% end %>
+
+
diff --git a/app/views/users/search_user_course.js.erb b/app/views/users/search_user_course.js.erb
index 138eab6f9..eed7499d5 100644
--- a/app/views/users/search_user_course.js.erb
+++ b/app/views/users/search_user_course.js.erb
@@ -11,8 +11,10 @@
//$("#upload_box").css('display','block');
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
-<% else %>
+<% elsif params[:send_type] == 'file' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_popup' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
+<% elsif params[:send_type] == 'message' %>
+ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% end %>
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
diff --git a/app/views/users/search_user_org.js.erb b/app/views/users/search_user_org.js.erb
index fb6efec9a..877629e34 100644
--- a/app/views/users/search_user_org.js.erb
+++ b/app/views/users/search_user_org.js.erb
@@ -1,7 +1,9 @@
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
-<% else %>
+<% elsif params[:send_type] == 'file' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
+<% elsif params[:send_type] == 'message' %>
+ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% end %>
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb
index 926b7aa58..f80be34f8 100644
--- a/app/views/users/search_user_project.js.erb
+++ b/app/views/users/search_user_project.js.erb
@@ -1,7 +1,9 @@
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
-<% else %>
+<% elsif params[:send_type] == 'file' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
+<% elsif params[:send_type] == 'message' %>
+ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
<% end %>
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
diff --git a/app/views/users/share_message_to_course.js.erb b/app/views/users/share_message_to_course.js.erb
new file mode 100644
index 000000000..5a5046dfa
--- /dev/null
+++ b/app/views/users/share_message_to_course.js.erb
@@ -0,0 +1,2 @@
+hideModal();
+alert("发送成功!");
\ No newline at end of file
diff --git a/app/views/users/share_message_to_org.js.erb b/app/views/users/share_message_to_org.js.erb
new file mode 100644
index 000000000..5a5046dfa
--- /dev/null
+++ b/app/views/users/share_message_to_org.js.erb
@@ -0,0 +1,2 @@
+hideModal();
+alert("发送成功!");
\ No newline at end of file
diff --git a/app/views/users/share_message_to_project.js.erb b/app/views/users/share_message_to_project.js.erb
new file mode 100644
index 000000000..5a5046dfa
--- /dev/null
+++ b/app/views/users/share_message_to_project.js.erb
@@ -0,0 +1,2 @@
+hideModal();
+alert("发送成功!");
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 3a4d2fb92..4f191a9bf 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -541,6 +541,9 @@ RedmineApp::Application.routes.draw do
post 'share_news_to_course'
post 'share_news_to_project'
post 'share_news_to_org'
+ post 'share_message_to_course'
+ post 'share_message_to_project'
+ post 'share_message_to_org'
get 'resource_preview'
get 'rename_resource'
get 'search_user_project'
From b6e13340e56a09dfd4060760df1b744379466645 Mon Sep 17 00:00:00 2001
From: cxt
Date: Mon, 25 Jan 2016 15:33:50 +0800
Subject: [PATCH 038/110] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80?=
=?UTF-8?q?=E7=9A=84=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/words_controller.rb | 4 ++-
.../users/_user_journalsformessage.html.erb | 27 +++++++++++++++++--
app/views/words/create_reply.js.erb | 6 +----
app/views/words/destroy.js.erb | 12 ++++++---
4 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index d24427a9d..699a5e8ca 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -73,7 +73,6 @@ class WordsController < ApplicationController
# render 'test/index'
# }
format.js {
- @reply_type = params[:reply_type]
@user_activity_id = params[:user_activity_id]
@activity = JournalsForMessage.find(parent_id)
@is_activity = params[:is_activity]
@@ -95,6 +94,9 @@ class WordsController < ApplicationController
@user = User.find(@journal_destroyed.jour_id)
@jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count
@is_user = true
+ @user_activity_id = params[:user_activity_id] if params[:user_activity_id]
+ @is_activity = params[:is_activity].to_i if params[:is_activity]
+ @activity = @journal_destroyed.parent if @journal_destroyed.parent
elsif @journal_destroyed.jour_type == 'HomeworkCommon'
@homework = HomeworkCommon.find @journal_destroyed.jour_id
if params[:user_activity_id]
diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb
index e30fd1824..d7247621a 100644
--- a/app/views/users/_user_journalsformessage.html.erb
+++ b/app/views/users/_user_journalsformessage.html.erb
@@ -39,6 +39,22 @@
更新时间:<%= format_time(PrincipalActivity.where("principal_act_type='#{activity.class}' and principal_act_id =#{activity.id}").first.updated_at) %>
+ <% if activity.user == User.current || User.current.admin?%>
+
+
+
+
+
+ <%= link_to(l(:label_bid_respond_delete),
+ {:controller => 'words', :action => 'destroy', :object_id => activity, :user_id => activity.user,:user_activity_id => user_activity_id,:is_activity=>is_activity},
+ :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
+ :class => "postOptionLink", :title => l(:button_delete)) %>
+
+
+
+
+
+ <% end%>
@@ -71,7 +87,7 @@
<% fetch_user_leaveWord_reply(activity).reorder("created_on desc").each do |comment| %>
<% replies_all_i = replies_all_i + 1 %>
-
+
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
@@ -90,6 +106,14 @@
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %>
+
<%= comment.notes.html_safe %>
@@ -112,7 +136,6 @@
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
- <%= hidden_field_tag 'reply_type',params[:reply_type],:value =>'user' %>
<%= hidden_field_tag 'is_activity',params[:is_activity],:value =>is_activity %>
diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb
index d4d9a2cd7..d9e00a112 100644
--- a/app/views/words/create_reply.js.erb
+++ b/app/views/words/create_reply.js.erb
@@ -1,10 +1,6 @@
<% if @save_succ %>
<% if @user_activity_id %>
- <% if @reply_type == 'user' %>
- $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
- <% else %>
- $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
- <% end %>
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity");
<% else %>
<% if !@jfm.nil? && @jfm.jour_type == 'Principal' %>
diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb
index 6a56249a3..6d0055718 100644
--- a/app/views/words/destroy.js.erb
+++ b/app/views/words/destroy.js.erb
@@ -2,13 +2,19 @@
alert('<%=l(:notice_failed_delete)%>');
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication','HomeworkCommon'].include? @journal_destroyed.jour_type)%>
<% if @is_user%>
- var destroyedItem = $('#<%=@journal_destroyed.id%>');
+ <% if @activity %>
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
+ init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity");
+ <% else %>
+ $("#user_activity_<%= @user_activity_id%>").hide();
+ <% end %>
+ /*var destroyedItem = $('#<%#=@journal_destroyed.id%>');
destroyedItem.fadeOut(600,function(){
destroyedItem.remove();
});
- <% if @jours_count && @jours_count == 0 %>
+ <%# if @jours_count && @jours_count == 0 %>
$("#user_jour_list").css("padding","0px");
- <% end %>
+ <%# end %>*/
<% else %>
<% if @bid && @jours_count %>
$('#jours_count').html("<%= @jours_count %>");
From 184e0ee6898bd1a034f93cf711acc926eb6d8e93 Mon Sep 17 00:00:00 2001
From: cxt
Date: Mon, 25 Jan 2016 16:50:34 +0800
Subject: [PATCH 039/110] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C?=
=?UTF-8?q?=E9=9D=A2=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E3=80=81=E7=BB=84?=
=?UTF-8?q?=E7=BB=87=E3=80=81=E8=AF=BE=E7=A8=8B=E3=80=81=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E3=80=81=E4=BD=9C=E4=B8=9A=E4=B8=AA=E6=95=B0=E7=9A=84=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 1 +
lib/redmine/menu_manager.rb | 17 +++++++++++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 68386de44..c7b4dc615 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -29,6 +29,7 @@ class AdminController < ApplicationController
def index
@no_configuration_data = Redmine::DefaultData::Loader::no_data?
+ @lastest_login_user_count = User.all.count
end
def projects
diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb
index a2d2214b6..f9ce21987 100644
--- a/lib/redmine/menu_manager.rb
+++ b/lib/redmine/menu_manager.rb
@@ -1,3 +1,4 @@
+#coding=utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@@ -180,8 +181,20 @@ module Redmine
end
def render_single_menu_node(item, caption, url, selected)
-
- link_to(h(caption), url, item.html_options(:selected => selected))
+ title = h(caption)
+ case title
+ when '作业'
+ title = h(caption) + "(#{HomeworkCommon.all.count})"
+ when '组织列表'
+ title = h(caption) + "(#{Organization.all.count})"
+ when '项目列表'
+ title = h(caption) + "(#{Project.all.count})"
+ when '课程列表'
+ title = h(caption) + "(#{Course.all.count})"
+ when '用户列表'
+ title = h(caption) + "(#{User.all.count})"
+ end
+ link_to(title, url, item.html_options(:selected => selected))
end
From 945d0a933f527337764393a6f0959071dffa1dfa Mon Sep 17 00:00:00 2001
From: cxt
Date: Mon, 25 Jan 2016 17:34:04 +0800
Subject: [PATCH 040/110] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=B8=BA=E8=B4=9F=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 1 -
app/controllers/users_controller.rb | 6 ++++++
db/schema.rb | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index c7b4dc615..68386de44 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -29,7 +29,6 @@ class AdminController < ApplicationController
def index
@no_configuration_data = Redmine::DefaultData::Loader::no_data?
- @lastest_login_user_count = User.all.count
end
def projects
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index b155e9f90..8794808a3 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1633,6 +1633,9 @@ class UsersController < ApplicationController
attach_copied_obj.attachtype = 1
end
attach_copied_obj.save
+ unless Project.find(project_id).project_score.nil?
+ Project.find(project_id).project_score.update_attribute(:attach_num, Project.find(project_id).project_score.attach_num + 1)
+ end
end
end
elsif params[:send_ids].present?
@@ -1668,6 +1671,9 @@ class UsersController < ApplicationController
attach_copied_obj.attachtype = 1
end
attach_copied_obj.save
+ unless Project.find(project_id).project_score.nil?
+ Project.find(project_id).project_score.update_attribute(:attach_num, Project.find(project_id).project_score.attach_num + 1)
+ end
end
end
end
diff --git a/db/schema.rb b/db/schema.rb
index b2c74a96c..8af34d878 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1371,6 +1371,7 @@ ActiveRecord::Schema.define(:version => 20160122143138) do
t.integer "changeset_num", :default => 0
t.integer "board_message_num", :default => 0
t.integer "board_num", :default => 0
+ t.integer "act_num", :default => 0
t.integer "attach_num", :default => 0
t.datetime "commit_time"
end
From dda64245b3056c3b2e823f7b9295bb89b068ad30 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Tue, 26 Jan 2016 10:35:54 +0800
Subject: [PATCH 041/110] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BB=A5=E4=B8=8B?=
=?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9A1.=E7=BC=96=E8=BE=91=E4=B8=AA?=
=?UTF-8?q?=E4=BA=BA=E9=A6=96=E9=A1=B5=E5=90=8E=EF=BC=8C=E8=BF=94=E5=9B=9E?=
=?UTF-8?q?=E8=87=B3=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81=EF=BC=9B2.?=
=?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=90=8D=E7=89=87=E4=B8=AD=EF=BC=8C=E6=AD=A3?=
=?UTF-8?q?=E7=A1=AE=E6=98=BE=E7=A4=BA=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=EF=BC=9B3.=E5=90=8C=E6=84=8F=E7=94=B3=E8=AF=B7=E5=AD=90?=
=?UTF-8?q?=E5=9F=9F=E5=90=8D=E5=90=8E=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=B7=B2?=
=?UTF-8?q?=E5=90=8C=E6=84=8F=E7=94=B3=E8=AF=B7=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/blog_comments_controller.rb | 4 ++--
app/views/users/_show_detail_info.html.erb | 9 +++++++--
app/views/users/_user_message_org.html.erb | 2 +-
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb
index df6ba10d2..055236302 100644
--- a/app/controllers/blog_comments_controller.rb
+++ b/app/controllers/blog_comments_controller.rb
@@ -55,8 +55,8 @@ class BlogCommentsController < ApplicationController
if params[:in_act]
redirect_to user_path(params[:user_id])
else
- if params[:is_homepage]
- redirect_to user_blogs_path(params[:user_id])
+ if @article.id.eql?(User.find(params[:user_id]).blog.homepage_id)
+ redirect_to user_path(params[:user_id])
else
redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id])
end
diff --git a/app/views/users/_show_detail_info.html.erb b/app/views/users/_show_detail_info.html.erb
index dc6599884..9de431336 100644
--- a/app/views/users/_show_detail_info.html.erb
+++ b/app/views/users/_show_detail_info.html.erb
@@ -6,11 +6,16 @@
<%= user %>
-
+ <% if (user.user_extensions && (user.user_extensions.identity != 2) ) %>
+
+ <% end %>
+
<%= user.show_name %>
- <%= user.user_extensions.technical_title %>
+ <% if user.user_extensions && user.user_extensions.identity %>
+ <%= get_user_roll(user) %>
+ <% end %>
diff --git a/app/views/users/_user_message_org.html.erb b/app/views/users/_user_message_org.html.erb
index 5bf1c8950..e3b656a46 100644
--- a/app/views/users/_user_message_org.html.erb
+++ b/app/views/users/_user_message_org.html.erb
@@ -12,7 +12,7 @@
<%= ma.content %>
- <%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"已同意申请",
+ <%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"申请已批准",
agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ),
:id => "agree_apply_subdomain_#{ma.id}",
:method => 'post',
From 63d1d3a8e7c1ff91f59cb9a592a07e18b82f187f Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Tue, 26 Jan 2016 10:59:28 +0800
Subject: [PATCH 042/110] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=8F=AA=E8=A6=81=E6=98=AF=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E6=88=90=E5=91=98=E5=B0=B1=E6=98=BE=E7=A4=BA=E7=BC=96=E8=BE=91?=
=?UTF-8?q?issue=E5=A4=9A=E5=B1=9E=E6=80=A7=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_project_issue.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb
index 1e9f1bb68..c5d93e0a5 100644
--- a/app/views/users/_project_issue.html.erb
+++ b/app/views/users/_project_issue.html.erb
@@ -52,7 +52,7 @@
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<%# 局部刷新:修改xissue属性 %>
- <% if is_project_manager?(User.current, activity.project) %>
+ <% if User.current.member_of?(activity.project) %>
<% unless params[:action] == "index" %>
<%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
From 821ade7985401ba8dc43cb40d2b74b5612e02654 Mon Sep 17 00:00:00 2001
From: Tim
Date: Tue, 26 Jan 2016 11:00:24 +0800
Subject: [PATCH 043/110] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E8=AF=BE=E7=A8=8B=E5=8A=A0=E5=85=A5?=
=?UTF-8?q?=E9=80=80=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_project_info.html.erb | 4 +-
.../_programing_work_show.html.erb | 279 +++++++++---------
app/views/student_work/_show.html.erb | 277 ++++++++---------
.../_work_attachments_status.html.erb | 2 +-
4 files changed, 282 insertions(+), 280 deletions(-)
diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb
index 60fc6f96d..98670dba0 100644
--- a/app/views/layouts/_project_info.html.erb
+++ b/app/views/layouts/_project_info.html.erb
@@ -9,13 +9,13 @@
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
-<%= @course.is_public == 0 ? "私有课程" : "公开课程" %>
+
ID:<%= @course.id%><%= @course.is_public == 0 ? "(私有)" : "(公开)" %>
<% if @course.id == 370 %>
<% end %>
-ID:<%= @course.id%>
+
加入课程
-
- <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
-
-
- <%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%>
-
- <% end%>
- <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%>
-
-
- <%= render :partial => 'student_work_praise' %>
-
- <% end%>
-
-
-
- 编程代码:
- <%= work.description if work.description%>
-
-
-
-
-
-
-
- 测试结果:
-
-
- <% work.student_work_tests.each_with_index do |test, index| %>
-
-
- 第<%= work.student_work_tests.count - index%>次测试
-
-
- <%= test.created_at.to_s(:db) %>
-
-
-
- <% if test.status.to_i == -2 %>
-
- <%= test.results.first %>
-
- <% else %>
-
-
- <% test.results.each_with_index do |x, i| %>
-
- 测试<%=i+1%>
- <% if x["status"].to_i != 0 %>
- 测试错误!
- 您的输出:
- <%=x["result"]%>
- 正确输出:
- <%=x["output"]%>
-
- <% else %>
- 测试正确!
-
- <% end %>
-
- <% end %>
-
-
- <% end %>
- <% end %>
-
-
-
-
- <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%>
-
-
- <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
-
- <% end%>
-
-
-
-
-
- <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
-
-
-
-
- <%student_work_scores.each do |student_score|%>
-
- <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
-
- <% end%>
-
-
-
收起
-
-
-
+
+
+
+
+
+ <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
+
+
+
+
+ <%student_work_scores.each do |student_score|%>
+
+ <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
+
+ <% end%>
+
+
+
+
收起
+
+
+
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb
index 662ddece4..d66a30718 100644
--- a/app/views/student_work/_show.html.erb
+++ b/app/views/student_work/_show.html.erb
@@ -1,139 +1,140 @@
-
-
- <% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %>
- <% if @homework.homework_type != 3 %>
- <% is_my_work = work.user == User.current%>
- <% else %>
- <% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
- <% is_my_work = pro && pro.student_work_id == work.id%>
- <% end %>
-
-
- 上交时间:
- <%=format_time work.created_at %>
-
-
- <% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
-
-
- <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
-
-
- <%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
-
- <% end%>
- <% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %>
-
-
- <%= render :partial => 'student_work_praise' %>
-
- <% end%>
-
-
-
-
- <% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
-
-
- 参与人员:
- <%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%>
- <% members = work.student_work_projects.where("is_leader = 0") %>
- <% members.each do |member| if !members.empty? %>
- 、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %>
- <% end %>
- <% end %>
-
- <% if @homework.homework_detail_group.base_on_project == 1 %>
-
- 关联项目:
- <% if work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
- <%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
- <% else %>
- <%=work.project.name %>
- <% end %>
- <%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
- (综合评分:<%=work.project.project_score.score.to_i %> )
-
- <% end %>
- <% end%>
-
-
- 内容:
-
- <%= text_format(work.description) if work.description%>
-
-
-
-
- 附件:
- <% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
- <% if com_attachments.empty?%>
- 尚未提交附件
- <% else%>
-
- <%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
-
- <% end%>
-
-
-
- <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
-
-
- <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
-
- <% end%>
-
-
-
-
-
- <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
-
-
-
-
- <%student_work_scores.each do |student_score|%>
-
- <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
-
- <% end%>
-
-
-
收起
-
-
-
\ No newline at end of file
diff --git a/app/views/student_work/_work_attachments_status.html.erb b/app/views/student_work/_work_attachments_status.html.erb
index c4b2a795e..6a8591197 100644
--- a/app/views/student_work/_work_attachments_status.html.erb
+++ b/app/views/student_work/_work_attachments_status.html.erb
@@ -1,7 +1,7 @@
<% attachments.each_with_index do |attachment,i| %>
-
+
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw360', :download => true -%>
From 520811fdc79fbae2b94644ee016322774bb694a2 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 26 Jan 2016 11:17:55 +0800
Subject: [PATCH 044/110] =?UTF-8?q?=E7=95=99=E8=A8=80=E6=8C=89=E5=9B=9E?=
=?UTF-8?q?=E5=A4=8D=E7=9A=84=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E6=8E=92?=
=?UTF-8?q?=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 18 ++++++-----------
app/controllers/words_controller.rb | 1 +
app/models/journals_for_message.rb | 2 +-
...160126024429_update_journal_for_message.rb | 20 +++++++++++++++++++
db/schema.rb | 2 +-
5 files changed, 29 insertions(+), 14 deletions(-)
create mode 100644 db/migrate/20160126024429_update_journal_for_message.rb
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 8794808a3..cb8afd3a1 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -755,23 +755,17 @@ class UsersController < ApplicationController
if params[:type].present?
case params[:type]
when "public"
- jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 0').order('created_on DESC')
- @jour_count = jours.count
- @jour = jours.limit(10).offset(@page * 10)
+ jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 0').order('updated_on DESC')
when "private"
- jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 1').order('created_on DESC')
- @jour_count = jours.count
- @jour = jours.limit(10).offset(@page * 10)
+ jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 1').order('updated_on DESC')
else
- jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
- @jour_count = jours.count
- @jour = jours.limit(10).offset(@page * 10)
+ jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('updated_on DESC')
end
else
- jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
- @jour_count = jours.count
- @jour = jours.limit(10).offset(@page * 10)
+ jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('updated_on DESC')
end
+ @jour_count = jours.count
+ @jour = jours.limit(10).offset(@page * 10)
@type = params[:type]
if User.current == @user
jours.update_all(:is_readed => true, :status => false)
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 699a5e8ca..351be4e64 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -62,6 +62,7 @@ class WordsController < ApplicationController
update_forge_activity('JournalsForMessage',parent_id)
update_org_activity('JournalsForMessage',parent_id)
update_principal_activity('JournalsForMessage',parent_id)
+ (JournalsForMessage.find parent_id).update_attribute(:updated_on,Time.now)
end
respond_to do |format|
# format.html {
diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb
index 9e0ce2dd2..cdcf9d19e 100644
--- a/app/models/journals_for_message.rb
+++ b/app/models/journals_for_message.rb
@@ -70,7 +70,7 @@ class JournalsForMessage < ActiveRecord::Base
validates :notes, presence: true, if: :is_homework_jour?
after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, :act_as_at_message, :act_as_user_feedback_message, :act_as_principal_activity, :act_as_student_score
after_create :reset_counters!
- after_update :update_ativity
+ #after_update :update_activity
after_destroy :reset_counters!
after_save :be_user_score
after_destroy :down_user_score
diff --git a/db/migrate/20160126024429_update_journal_for_message.rb b/db/migrate/20160126024429_update_journal_for_message.rb
new file mode 100644
index 000000000..f6b848c79
--- /dev/null
+++ b/db/migrate/20160126024429_update_journal_for_message.rb
@@ -0,0 +1,20 @@
+class UpdateJournalForMessage < ActiveRecord::Migration
+ def up
+ journals = JournalsForMessage.where("m_parent_id is null and jour_type ='Principal' ")
+ count = journals.count / 30 + 2
+ transaction do
+ for i in 1 ... count do i
+ journals.page(i).per(30).each do |jour|
+ act = UserActivity.where("act_type='JournalsForMessage' and act_id = #{jour.id}").first
+ unless act.nil?
+ jour.updated_on = act.updated_at
+ jour.save
+ end
+ end
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 8af34d878..736ce0f4e 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20160122143138) do
+ActiveRecord::Schema.define(:version => 20160126024429) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
From 19003f27fca2dcbd89d4c79ad829bbbbc9205882 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 26 Jan 2016 15:05:45 +0800
Subject: [PATCH 045/110] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=B7=BB=E5=8A=A0is?=
=?UTF-8?q?=5Fcopy=E5=B1=9E=E6=80=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 5 ++++-
db/migrate/20160126031857_add_is_copy_to_course.rb | 5 +++++
db/schema.rb | 3 ++-
3 files changed, 11 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/20160126031857_add_is_copy_to_course.rb
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 43a49c7d9..0697f0d0a 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -441,7 +441,10 @@ class CoursesController < ApplicationController
@course = cs.create_course(params,User.current)[:course]
if params[:copy_course]
copy_course = Course.find params[:copy_course].to_i
- @course.update_attributes(:open_student => copy_course.open_student, :publish_resource => copy_course.publish_resource)
+ @course.is_copy = 1
+ @course.open_student = copy_course.open_student
+ @course.publish_resource = copy_course.publish_resource
+ @course.save
if params[:checkAll]
attachments = copy_course.attachments
attachments.each do |attachment|
diff --git a/db/migrate/20160126031857_add_is_copy_to_course.rb b/db/migrate/20160126031857_add_is_copy_to_course.rb
new file mode 100644
index 000000000..f60914bbd
--- /dev/null
+++ b/db/migrate/20160126031857_add_is_copy_to_course.rb
@@ -0,0 +1,5 @@
+class AddIsCopyToCourse < ActiveRecord::Migration
+ def change
+ add_column :courses, :is_copy, :integer, :default => 0
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 736ce0f4e..42a5ea702 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20160126024429) do
+ActiveRecord::Schema.define(:version => 20160126031857) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -501,6 +501,7 @@ ActiveRecord::Schema.define(:version => 20160126024429) do
t.string "end_term"
t.integer "is_excellent", :default => 0
t.integer "excellent_option", :default => 0
+ t.integer "is_copy", :default => 0
end
create_table "custom_fields", :force => true do |t|
From 89a919163c58a751f13d07cdb47ae14574fd1d02 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Tue, 26 Jan 2016 15:25:25 +0800
Subject: [PATCH 046/110] =?UTF-8?q?=E4=B8=80=E6=97=A6=E7=BB=84=E7=BB=87?=
=?UTF-8?q?=E7=A7=81=E6=9C=89=EF=BC=8C=E5=B0=B1disabled=E6=8E=89=E5=85=81?=
=?UTF-8?q?=E8=AE=B8=E6=B8=B8=E5=AE=A2=E4=B8=8B=E8=BD=BD=E9=80=89=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/organizations/new.html.erb | 5 +++--
app/views/organizations/setting.html.erb | 14 ++++++++++++--
public/javascripts/application.js | 13 +++++++++++++
3 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb
index ea7fbbb30..e12bf3849 100644
--- a/app/views/organizations/new.html.erb
+++ b/app/views/organizations/new.html.erb
@@ -30,14 +30,15 @@
公开 :
-
+
(打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)
允许游客下载:
-
+
(打钩为允许游客下载文件)
+
diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb
index 9ec118bec..b9b2f9b4c 100644
--- a/app/views/organizations/setting.html.erb
+++ b/app/views/organizations/setting.html.erb
@@ -63,11 +63,12 @@
公开 :
- class="ml3" />
+ class="ml3" />
下载支持 :
- class="ml3" />
+ name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
允许游客下载
+ <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
保存
<% end %>
@@ -187,4 +188,13 @@
$("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入");
}
}
+
+// $(document).ready(function(){
+// if ( $("#is_public").attr("checked") != true){
+// alert($(this).attr("checked"));
+// $("#allow_download").attr("checked", false);
+// $("#allow_download").attr("disabled", true);
+// $("#allow_down_hint").html("");
+// }
+// });
\ No newline at end of file
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index f982d92f6..8fba6770a 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1135,3 +1135,16 @@ function chooseSendType(res_id,res_ids, user_id, send_type){
}
lastSendType = sendType;
}
+
+function disable_down(source, des, hint){
+ if (source.attr("checked")){
+ des.attr("disabled", false);
+ hint.html("");
+ }
+ else{
+ des.attr("checked", false);
+ des.attr("disabled", true);
+ hint.html("(私有组织不允许游客下载资源)");
+
+ }
+}
From af7ca36c92ad8f8bcbf0931e8d4293d292b05243 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 26 Jan 2016 15:59:39 +0800
Subject: [PATCH 047/110] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=8A=A0=E5=85=A5?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=88=96=E9=80=80=E5=87=BA=E8=AF=BE=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/courses_helper.rb | 9 ++++-----
app/views/layouts/_project_info.html.erb | 5 ++++-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index 4e90fc106..f326f2099 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -697,17 +697,16 @@ module CoursesHelper
def join_in_course_header(course, user, options=[])
if user.logged?
joined = course.members.map{|member| member.user_id}.include? user.id
- text = joined ? (" ".html_safe + l(:label_course_exit_student)) : (" ".html_safe + l(:label_course_join_student))
+ text = joined ? l(:label_course_exit_student) : l(:label_course_join_student)
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
method = joined ? 'delete' : 'post'
if joined
- link = " #{l(:label_course_join_student)} " + link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
+ link = link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
else
- link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "pr_join_a") + " #{l(:label_course_exit_student)} ".html_safe
+ link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "pr_join_a")
end
else
- link = " #{l(:label_course_join_student)} " +
- " #{l(:label_course_exit_student)} "
+ link = "#{l(:label_course_join_student)} "
end
link.html_safe
end
diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb
index d4b5b20fe..db9e24a36 100644
--- a/app/views/layouts/_project_info.html.erb
+++ b/app/views/layouts/_project_info.html.erb
@@ -15,7 +15,10 @@
<% end %>
-
加入课程
+ <% unless is_teacher %>
+
+
+ <% end %>
<% case object_flag %>
<% when '10' %>
From 4b95ee95c073876faa641a07dfa6dfc87b70e981 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Wed, 27 Jan 2016 16:12:34 +0800
Subject: [PATCH 052/110] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=B8=96=E5=AD=90?=
=?UTF-8?q?=E6=A0=8F=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA=E4=B8=AD=E7=9A=84?=
=?UTF-8?q?=E5=B8=96=E5=AD=90=EF=BC=8C=E5=9C=A8=E7=99=BB=E9=99=86=E6=83=85?=
=?UTF-8?q?=E5=86=B5=E4=B8=8B=E5=B0=B1=E8=83=BD=E5=8F=91=E9=80=81=EF=BC=9B?=
=?UTF-8?q?=E5=9C=A8=E7=BB=84=E7=BB=87=E6=A0=8F=E7=9B=AE=E4=B8=AD=EF=BC=8C?=
=?UTF-8?q?=E5=AF=B9=E5=B8=96=E5=AD=90=E6=A0=8F=E7=9B=AE=E8=AE=A8=E8=AE=BA?=
=?UTF-8?q?=E5=8C=BA=E5=A2=9E=E5=8A=A0=E7=BC=96=E8=BE=91=E3=80=81=E5=88=A0?=
=?UTF-8?q?=E9=99=A4=E3=80=81=E5=8F=91=E9=80=81=E9=80=89=E9=A1=B9=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../messages/_org_subfield_show.html.erb | 2 +-
.../_org_subfield_message.html.erb | 25 +++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb
index 7fdf5d02c..1e31881d5 100644
--- a/app/views/messages/_org_subfield_show.html.erb
+++ b/app/views/messages/_org_subfield_show.html.erb
@@ -68,7 +68,7 @@
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
- <% if @message.org_subfield_editable_by?(User.current) %>
+ <% if User.current.logged? %>
From ec41cd4318c79ae5637c44c7299310d59d2d685e Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 27 Jan 2016 17:26:57 +0800
Subject: [PATCH 053/110] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=85=B1=E4=BA=AB?=
=?UTF-8?q?=E9=A2=98=E5=BA=93=E4=B8=AD=E7=9A=84=E4=BD=9C=E4=B8=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 57 ++++++++++++++-
.../_homework_detail_information.html.erb | 27 +++++++
.../users/_homework_search_input.html.erb | 29 ++++++++
.../users/_show_user_homework_form.html.erb | 33 ++++++---
app/views/users/_show_user_homeworks.html.erb | 71 ++++++++++++-------
app/views/users/_user_homework_form.html.erb | 2 +-
app/views/users/show_homework_detail.js.erb | 1 +
app/views/users/user_homework_type.js.erb | 4 ++
app/views/users/user_import_homeworks.js.erb | 7 +-
app/views/users/user_search_homeworks.js.erb | 4 +-
config/routes.rb | 6 +-
public/stylesheets/new_user.css | 23 +++++-
public/stylesheets/public.css | 21 ++++++
13 files changed, 238 insertions(+), 47 deletions(-)
create mode 100644 app/views/users/_homework_detail_information.html.erb
create mode 100644 app/views/users/_homework_search_input.html.erb
create mode 100644 app/views/users/show_homework_detail.js.erb
create mode 100644 app/views/users/user_homework_type.js.erb
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index cb8afd3a1..51feecb23 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -403,8 +403,47 @@ class UsersController < ApplicationController
#导入作业
def user_import_homeworks
+ @user = User.current
@select_course = params[:select_course] ? 1 : 0
- @user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
+ #@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
+ visible_course = Course.where("is_public = 1 && is_delete = 0")
+ visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
+ @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids}").order("created_at desc")
+ @type = params[:type]
+ @limit = 10
+ @is_remote = true
+ @hw_count = @homeworks.count
+ @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
+ @offset ||= @hw_pages.offset
+ @homeworks = paginateHelper @homeworks,10
+ respond_to do |format|
+ format.js
+ end
+ end
+
+ def user_homework_type
+ @user = User.current
+ if(params[:type].blank? || params[:type] == "1") #公共题库
+ visible_course = Course.where("is_public = 1 && is_delete = 0")
+ visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
+ @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids}").order("created_at desc")
+ elsif params[:type] == "2" #我的题库
+ @homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
+ end
+ @type = params[:type]
+ @limit = 10
+ @is_remote = true
+ @hw_count = @homeworks.count
+ @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
+ @offset ||= @hw_pages.offset
+ @homeworks = paginateHelper @homeworks,10
+ respond_to do |format|
+ format.js
+ end
+ end
+
+ def show_homework_detail
+ @homework = HomeworkCommon.find params[:homework].to_i
respond_to do |format|
format.js
end
@@ -412,7 +451,21 @@ class UsersController < ApplicationController
#用户主页过滤作业
def user_search_homeworks
- @user_homeworks = HomeworkCommon.where("user_id = '#{@user.id}' and lower(name) like '%#{params[:name].to_s.downcase}%'").order("created_at desc")
+ search = params[:name].to_s.strip.downcase
+ if(params[:type].blank? || params[:type] == "1") #全部
+ visible_course = Course.where("is_public = 1 && is_delete = 0")
+ visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
+ @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and (name like '%#{search}%')").order("created_at desc")
+ elsif params[:type] == "2" #课程资源
+ @homeworks = HomeworkCommon.where("user_id = #{@user.id} and (name like '%#{search}%')").order("created_at desc")
+ end
+ @type = params[:type]
+ @limit = 10
+ @is_remote = true
+ @hw_count = @homeworks.count
+ @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
+ @offset ||= @hw_pages.offset
+ @homeworks = paginateHelper @homeworks,10
respond_to do |format|
format.js
end
diff --git a/app/views/users/_homework_detail_information.html.erb b/app/views/users/_homework_detail_information.html.erb
new file mode 100644
index 000000000..6887444ab
--- /dev/null
+++ b/app/views/users/_homework_detail_information.html.erb
@@ -0,0 +1,27 @@
+题目信息
+
+ <% if homework.nil? %>
+
请先在左侧选择作业
+ <% else %>
+
标题:<%=homework.name %>
+ 来源:<%=homework.course.name %>
+ <% if homework.homework_type == 2 && homework.homework_detail_programing %>
+ 编程语言:<%=homework.language_name %>
+ <% end %>
+ 贡献者:<%=homework.user.show_name %>
+ 描述如下:
+
+
+ <%=homework.description.html_safe %>
+
+ <% if homework.homework_type == 2 %>
+
+ 测试集:<%=homework.homework_tests.count %>组
+
+ <% elsif homework.homework_type ==3 && homework.homework_detail_group %>
+
+ 分组人数:<%=homework.homework_detail_group.min_num %> - <%=homework.homework_detail_group.max_num %>人
+
+ <% end %>
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/users/_homework_search_input.html.erb b/app/views/users/_homework_search_input.html.erb
new file mode 100644
index 000000000..ba85f0d09
--- /dev/null
+++ b/app/views/users/_homework_search_input.html.erb
@@ -0,0 +1,29 @@
+
+
\ No newline at end of file
diff --git a/app/views/users/_show_user_homework_form.html.erb b/app/views/users/_show_user_homework_form.html.erb
index ef0265683..bd70e27fb 100644
--- a/app/views/users/_show_user_homework_form.html.erb
+++ b/app/views/users/_show_user_homework_form.html.erb
@@ -1,13 +1,24 @@
-<% user_homeworks.each do |homework|%>
-