<%= link_to truncate(file.filename,length: 35, omission: '...'),
From f9880a00fdd91dbcdf3bd292941abec28254415f Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 1 Jul 2015 16:41:17 +0800
Subject: [PATCH 15/26] =?UTF-8?q?admin=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=E5=8F=8A=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E8=B7=AF=E7=94=B1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 4 ++++
app/views/admin/courses.html.erb | 1 +
config/routes.rb | 1 +
lib/redmine.rb | 1 +
4 files changed, 7 insertions(+)
create mode 100644 app/views/admin/courses.html.erb
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 8e23041c6..fbfdf24c2 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -41,6 +41,10 @@ class AdminController < ApplicationController
render :action => "projects", :layout => false if request.xhr?
end
+ def courses
+
+ end
+
def users
sort_init 'login', 'asc'
sort_update %w(login firstname lastname mail admin created_on last_login_on)
diff --git a/app/views/admin/courses.html.erb b/app/views/admin/courses.html.erb
new file mode 100644
index 000000000..d1d06ad36
--- /dev/null
+++ b/app/views/admin/courses.html.erb
@@ -0,0 +1 @@
+1111
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 8b8d4a401..dea176f54 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -635,6 +635,7 @@ RedmineApp::Application.routes.draw do
match 'admin', :to => 'admin#index', :via => :get
match 'admin/projects', :via => :get
+ get 'admin/courses'
match 'admin/users', :via => :get
match 'admin/first_page_made', as: :first_page_made
match 'admin/course_page_made', as: :course_page_made
diff --git a/lib/redmine.rb b/lib/redmine.rb
index ba0fd0cee..3043cfe5d 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -367,6 +367,7 @@ end
Redmine::MenuManager.map :admin_menu do |menu|
menu.push :organization, {:controller => 'admin', :action => 'organization'}, :caption => :label_organization_list
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
+ menu.push :courses, {:controller => 'admin', :action => 'courses'}, :caption => :label_course_all
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
menu.push :first_page_made, {:controller => 'admin',:action => 'first_page_made'},:caption => :label_first_page_made
menu.push :mobile_version, {:controller => 'admin',:action => 'mobile_version'},:caption => :label_mobile_version
From d48a7335025556540b355fe025a2ebff69737a02 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 1 Jul 2015 16:49:50 +0800
Subject: [PATCH 16/26] =?UTF-8?q?1=E3=80=81=E8=B0=83=E6=95=B4admin?=
=?UTF-8?q?=E7=95=8C=E9=9D=A2=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=A0=B7=E5=BC=8F=202=E3=80=81=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=BA=8F=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/admin/projects.html.erb | 112 ++++++++++++++++--------------
1 file changed, 60 insertions(+), 52 deletions(-)
diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb
index 4c9479a6d..f5b7955bf 100644
--- a/app/views/admin/projects.html.erb
+++ b/app/views/admin/projects.html.erb
@@ -1,5 +1,5 @@
-<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %>
+ <%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %>
@@ -7,62 +7,70 @@
<%= form_tag({}, :method => :get) do %>
-
<% end %>
<% html_title(l(:label_project_plural)) -%>
From 749b9c4429d6e4fa745ecd0c2db83919d6a43637 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 1 Jul 2015 17:02:30 +0800
Subject: [PATCH 17/26] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E6=A0=B9=E6=8D=AEID=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 2 +-
app/models/project.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index fbfdf24c2..a01bba913 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -34,7 +34,7 @@ class AdminController < ApplicationController
def projects
@status = params[:status] || 1
- scope = Project.status(@status).order('lft')
+ scope = Project.status(@status).order('id asc')
scope = scope.like(params[:name]) if params[:name].present?
@projects = scope.where(project_type: Project::ProjectType_project).all
diff --git a/app/models/project.rb b/app/models/project.rb
index 49ed2d0ee..f201e6e3c 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -839,7 +839,7 @@ class Project < ActiveRecord::Base
# Yields the given block for each project with its level in the tree
def self.project_tree(projects, &block)
ancestors = []
- projects.sort_by(&:lft).each do |project|
+ projects.sort_by(&:id).each do |project|
while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
ancestors.pop
end
From 07d95bdda9345c617224c7e268448555a784a638 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 1 Jul 2015 17:34:17 +0800
Subject: [PATCH 18/26] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E5=86=85=E5=AE=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 6 ++-
app/views/admin/courses.html.erb | 77 ++++++++++++++++++++++++++++-
config/locales/commons/zh.yml | 2 +-
3 files changed, 82 insertions(+), 3 deletions(-)
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index a01bba913..086ecfb7f 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -42,7 +42,11 @@ class AdminController < ApplicationController
end
def courses
-
+ @name = params[:name]
+ @courses = Course.like(@name)
+ respond_to do |format|
+ format.html
+ end
end
def users
diff --git a/app/views/admin/courses.html.erb b/app/views/admin/courses.html.erb
index d1d06ad36..1615bccbc 100644
--- a/app/views/admin/courses.html.erb
+++ b/app/views/admin/courses.html.erb
@@ -1 +1,76 @@
-1111
\ No newline at end of file
+
+ <%= link_to l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
+
+
+
+ <%=l(:label_course_all)%>
+
+
+<%= form_tag({}, :method => :get) do %>
+
+
+ <%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %>
+ <%= submit_tag l(:button_apply), :class => "small", :name => nil %>
+
+ <%= l(:button_clear)%>
+
+
+<% end %>
+
+
+
+
+<% html_title(l(:label_course_all)) -%>
diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml
index f83d3810c..5dee0b505 100644
--- a/config/locales/commons/zh.yml
+++ b/config/locales/commons/zh.yml
@@ -263,7 +263,7 @@ zh:
label_tags_numbers: "Tag统计"
label_issue_plural: 问题跟踪
- label_project_plural: 项目列表
+# label_project_plural: 项目列表
label_user_plural: 用户列表
label_tags_call: 需求
field_filename: 文件
From af59cd9ba7757b4630a29a4bbfc7c94c93a0ca0a Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 2 Jul 2015 08:43:41 +0800
Subject: [PATCH 19/26] =?UTF-8?q?1=E3=80=81=E9=A1=B9=E7=9B=AEissue?=
=?UTF-8?q?=E5=8C=BA=E5=88=86=E4=B8=BB=E8=B4=B4=E5=92=8C=E5=9B=9E=E5=B8=96?=
=?UTF-8?q?=202=E3=80=81=E5=BC=95=E7=94=A8=E6=A8=A1=E5=BC=8F=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/journals_controller.rb | 1 +
app/models/mailer.rb | 2 +-
app/views/issues/_edit.html.erb | 4 +++-
app/views/issues/_history.html.erb | 8 +++++---
app/views/issues/show.html.erb | 3 +++
app/views/journals/new.js.erb | 6 +++---
6 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb
index aa3a7e0ea..d8cd8eeec 100644
--- a/app/controllers/journals_controller.rb
+++ b/app/controllers/journals_controller.rb
@@ -74,6 +74,7 @@ class JournalsController < ApplicationController
text = text.to_s.strip.gsub(%r{((.|\s)*?)
}m, '[...]')
@content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> "
@content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
+ @content = "" << @content
@id = user.id
rescue ActiveRecord::RecordNotFound
render_404
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 340559828..0d0b82752 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -186,7 +186,7 @@ class Mailer < ActionMailer::Base
@course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT jfm.* from journals_for_messages jfm, members m, courses c
where m.user_id = '#{user.id}' and c.id = m.course_id and jfm.jour_id = c.id
and jfm.jour_type='Course' and (jfm.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
-
+
@user_journal_messages = user.journals_for_messages.where("jour_type='Principal' and (created_on between '#{date_from}' and '#{date_to}')").order('created_on DESC')
# 查询user在项目中留言(用户反馈)
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index f7594d000..444016db8 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -20,8 +20,10 @@
<%= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %>
diff --git a/app/views/issues/_history.html.erb b/app/views/issues/_history.html.erb
index 04c46ed39..a5b1661eb 100644
--- a/app/views/issues/_history.html.erb
+++ b/app/views/issues/_history.html.erb
@@ -3,9 +3,9 @@