From 80b2a2dc45c05a0bdd96cfc7fc91d3e0a65c516f Mon Sep 17 00:00:00 2001
From: z9hang
Date: Mon, 4 Aug 2014 12:23:20 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=85=AC=E5=85=B1?=
=?UTF-8?q?=E8=B4=B4=E5=90=A7=E6=96=B0=E5=BB=BA=E5=B8=96=E5=AD=90=E9=97=AE?=
=?UTF-8?q?=E9=A2=98=20=E4=BF=AE=E6=AD=A3=E8=AF=BE=E7=A8=8B=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/memos_controller.rb | 7 ++++++-
app/helpers/project_score_helper.rb | 8 ++++++++
app/views/courses/_course.html.erb | 2 +-
db/schema.rb | 15 +--------------
4 files changed, 16 insertions(+), 16 deletions(-)
create mode 100644 app/helpers/project_score_helper.rb
diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb
index 587b198d7..7f71c2085 100644
--- a/app/controllers/memos_controller.rb
+++ b/app/controllers/memos_controller.rb
@@ -40,7 +40,12 @@ class MemosController < ApplicationController
end
def create
- @quote = params[:quote][:quote]
+ unless params[:quote].nil?
+ @quote = params[:quote][:quote]
+ else
+ @quote = ""
+ end
+
@memo = Memo.new(params[:memo])
@memo.forum_id = params[:forum_id]
@memo.author_id = User.current.id
diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb
new file mode 100644
index 000000000..3df2e05b5
--- /dev/null
+++ b/app/helpers/project_score_helper.rb
@@ -0,0 +1,8 @@
+# encoding: utf-8
+class ProjectScoreHelper
+ #缺陷数量
+ def issue_num project
+
+ end
+
+end
\ No newline at end of file
diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb
index 8e1a7950d..ddf08c3fb 100644
--- a/app/views/courses/_course.html.erb
+++ b/app/views/courses/_course.html.erb
@@ -44,7 +44,7 @@
<%= content_tag('span', "#{garble @course.members.count}", :class => "info") %>
<%#= content_tag('span', l(:label_x_member, :count => @course.members.count)) %>
- <%= content_tag('span', l(:label_x_member, :count => studentCount(@course)+teacherCount(@course))) %>
+ <%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %>
diff --git a/db/schema.rb b/db/schema.rb
index 7643adb4b..a721633fd 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -419,9 +419,9 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
t.string "web_title"
t.string "title"
t.text "description"
+ t.string "page_type"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
- t.string "page_type"
t.integer "sort_type"
t.integer "image_width", :default => 107
t.integer "image_height", :default => 63
@@ -882,19 +882,6 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
- create_table "rich_rich_files", :force => true do |t|
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "rich_file_file_name"
- t.string "rich_file_content_type"
- t.integer "rich_file_file_size"
- t.datetime "rich_file_updated_at"
- t.string "owner_type"
- t.integer "owner_id"
- t.text "uri_cache"
- t.string "simplified_type", :default => "file"
- end
-
create_table "roles", :force => true do |t|
t.string "name", :limit => 30, :default => "", :null => false
t.integer "position", :default => 1
From 426ea23d6e35d55814fec86046407b986ef62bfa Mon Sep 17 00:00:00 2001
From: z9hang
Date: Mon, 4 Aug 2014 17:30:29 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=B8=96=E5=AD=90?=
=?UTF-8?q?=E5=86=85=E5=AE=B9=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=8A=A5=E9=94=99?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/memos_controller.rb | 11 ++++++++---
app/views/memos/_reply_box.html.erb | 2 +-
app/views/memos/quote.js.erb | 2 +-
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb
index 7f71c2085..d7510c385 100644
--- a/app/controllers/memos_controller.rb
+++ b/app/controllers/memos_controller.rb
@@ -40,12 +40,17 @@ class MemosController < ApplicationController
end
def create
- unless params[:quote].nil?
- @quote = params[:quote][:quote]
- else
+
+ if params[:quote].nil?
@quote = ""
+ else
+ @quote = params[:quote]
end
+ #unless params[:quote].nil?
+ # @quote = params[:quote][:quote]
+ #end
+
@memo = Memo.new(params[:memo])
@memo.forum_id = params[:forum_id]
@memo.author_id = User.current.id
diff --git a/app/views/memos/_reply_box.html.erb b/app/views/memos/_reply_box.html.erb
index 18cfa032d..9dddf5be4 100644
--- a/app/views/memos/_reply_box.html.erb
+++ b/app/views/memos/_reply_box.html.erb
@@ -4,7 +4,7 @@
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
- <%= text_area :quote,:quote,:style => 'display:none' %>
+ <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<%= label_tag(l(:label_reply_plural)) %>:
<%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %>
diff --git a/app/views/memos/quote.js.erb b/app/views/memos/quote.js.erb
index a72b7ac9e..d2e8c1d17 100644
--- a/app/views/memos/quote.js.erb
+++ b/app/views/memos/quote.js.erb
@@ -1,4 +1,4 @@
//ckeditor.setData("<%= raw escape_javascript(@content) %>");
$('#message_quote').html("<%= raw escape_javascript(@temp.content) %>");
-$('#quote_quote').html("<%= raw escape_javascript(@content) %>");
+$('#quote').val("<%= raw escape_javascript(@content) %>");
showAndScrollTo("new_memo", "cke_editor01");
\ No newline at end of file
From 8c8127c8d97a694699c01167f51910ed18adf421 Mon Sep 17 00:00:00 2001
From: chenmin <19763783@qq.com>
Date: Mon, 4 Aug 2014 17:36:04 +0800
Subject: [PATCH 3/5] =?UTF-8?q?1016=20=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=95=8C=E9=9D=A2=E7=A9=BA=E8=A1=8C=E9=97=AE?=
=?UTF-8?q?=E9=A2=98=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/course.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index 46a6d03a1..63fdfc078 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -92,15 +92,15 @@
-
<% if User.current.logged? %>
+
该学校未开设任何课程,您可以查看其他学校课程
+
<% end %>
-
<% find_all_new_hot_course(9, @school_id).map do |course| %>
- /,"") %>>
From 8b217735c3f736709a6f54ba3b9fa81b43c01436 Mon Sep 17 00:00:00 2001
From: chenmin <19763783@qq.com>
Date: Tue, 5 Aug 2014 12:00:39 +0800
Subject: [PATCH 4/5] =?UTF-8?q?1029=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90=E6=8E=92=E5=BA=8F=E4=B8=8D?=
=?UTF-8?q?=E5=8F=AF=E7=94=A8=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index a8ba3d426..a2d791017 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -40,7 +40,19 @@ class FilesController < ApplicationController
render :layout => !request.xhr?
elsif params[:course_id]
@isproject = false
- @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
+ @order = params[:sort].split(",")[0];
+ @orderBy = @order.split(":")[0];
+ @orderType = @order.split(":")[1];
+ if @orderBy=="size"
+ @orderBy="filesize"
+ elsif @orderBy=="field_file_dense"
+ @orderBy="is_public"
+ elsif @orderBy=="attach_type"
+ @orderBy="attachtype"
+ elsif @orderBy=="content_type"
+ @orderBy="attachtype"
+ end
+ @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)]
render :layout => 'base_courses'
end
end
From fbe3e535b4c4af1759c1cfab6d08cbd8fe96b51f Mon Sep 17 00:00:00 2001
From: chenmin <19763783@qq.com>
Date: Tue, 5 Aug 2014 15:23:01 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E6=8E=92=E5=BA=8Fbug=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81=E6=97=B6=E9=97=B4=E6=AE=B5?=
=?UTF-8?q?=E7=BA=A6=E6=9D=9Fbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 4 +++-
app/controllers/files_controller.rb | 21 +++++++++++++++++----
app/views/courses/show.html.erb | 2 +-
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 85dfba8cf..6989b0b4f 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -624,7 +624,9 @@ class CoursesController < ApplicationController
"show_course_journals_for_messages" => true
}
@date_to ||= Date.today + 1
- @date_from = @date_to - @days-1.years
+ #
+ @date_from = (@date_to - @days) > @course.created_at.to_date ? (@date_to - @days) : @course.created_at.to_date
+ #@date_from = @date_to - @days-1.years
@author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id]))
# 决定显示所用用户或单个用户活动
@activity = Redmine::Activity::Fetcher.new(User.current, :course => @course,
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index a2d791017..9e41f467b 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -40,9 +40,17 @@ class FilesController < ApplicationController
render :layout => !request.xhr?
elsif params[:course_id]
@isproject = false
- @order = params[:sort].split(",")[0];
- @orderBy = @order.split(":")[0];
- @orderType = @order.split(":")[1];
+
+ if params[:sort]
+ if params[:sort].include?":"
+ @orderBy = params[:sort].split(":")[0];
+ @orderType = params[:sort].split(":")[1].split(",")[0];
+ else
+ @orderBy = params[:sort].split(",")[0];
+ @orderType = "asc";
+ end
+ end
+
if @orderBy=="size"
@orderBy="filesize"
elsif @orderBy=="field_file_dense"
@@ -52,7 +60,12 @@ class FilesController < ApplicationController
elsif @orderBy=="content_type"
@orderBy="attachtype"
end
- @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)]
+
+ if @orderBy
+ @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)]
+ else
+ @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on desc").find(@course.id)]
+ end
render :layout => 'base_courses'
end
end
diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb
index 8b713476e..deb590d1f 100644
--- a/app/views/courses/show.html.erb
+++ b/app/views/courses/show.html.erb
@@ -2,7 +2,7 @@
- <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
+ <%= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>
<% @events_by_day.keys.sort.reverse.each do |day| %>