From ee35de54474321e62308bf6738b8605865462cbf Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Fri, 29 May 2015 20:05:49 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E5=BF=BD=E7=95=A5redis=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 5810401cb..fdb7a3c6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
*.swp
/config/database.yml
/config/configuration.yml
+/config/additional_environment.rb
/files/*
/log/*
From 7bbd85f8c2046e1c5536b390f3a4e7a810e4c8ab Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Mon, 1 Jun 2015 13:50:06 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=A6=96=E9=A1=B5?=
=?UTF-8?q?=E8=B4=B4=E5=90=A7=E5=9B=9E=E5=A4=8D=E7=BC=93=E5=AD=98?=
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, 1 insertion(+), 3 deletions(-)
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index 476471897..256a976c4 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -195,7 +195,6 @@
<%= link_to "更多>>", forums_path %>
<% topics = find_new_forum_topics(10) %>
- <%# cache topics.maximum(:created_at) do%>
- <%# end %>
-<%= render partial: 'link_to_another' %>
\ No newline at end of file
+<%= render partial: 'link_to_another' %>
From e7868730615c0b20a1e80aea4e8190ad1f2db1bc Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Mon, 1 Jun 2015 13:58:37 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E8=BF=98=E6=98=AF=E7=BC=93=E5=AD=98?=
=?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/views/welcome/index.html.erb | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index 869df52a6..3acee0acf 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -123,7 +123,6 @@
<% topics = find_new_forum_topics(12) %>
- <% cache topics.maximum(:created_at) do%>
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
@@ -153,10 +152,9 @@
<% end %>
- <% end %>
-<%= render partial: 'link_to_another' %>
\ No newline at end of file
+<%= render partial: 'link_to_another' %>
From b6d22cfb314baf1c0605bc168370f91116acee63 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Mon, 1 Jun 2015 23:02:55 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E9=A2=84=E8=A7=88=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/attachments_controller.rb | 9 ++++++---
app/controllers/test_controller.rb | 6 ++++++
config/routes.rb | 1 +
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index d880ebe35..b2364165b 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -69,9 +69,12 @@ class AttachmentsController < ApplicationController
if candown || User.current.admin? || User.current.id == @attachment.author_id
@attachment.increment_download
if stale?(:etag => @attachment.digest)
- send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
- :type => detect_content_type(@attachment),
- :disposition => 'attachment' #inline can open in browser
+ req = RestClient.post 'http://192.168.80.107/Any2HtmlHandler.ashx', :txtDes => File.new(@attachment.diskfile, 'rb')
+ render :text => req.body
+
+ # send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
+ # :type => detect_content_type(@attachment),
+ # :disposition => 'attachment' #inline can open in browser
end
else
diff --git a/app/controllers/test_controller.rb b/app/controllers/test_controller.rb
index 51ff293f1..12fead4f2 100644
--- a/app/controllers/test_controller.rb
+++ b/app/controllers/test_controller.rb
@@ -1,3 +1,5 @@
+require 'net/http'
+
class TestController < ApplicationController
helper :UserScore
@@ -5,6 +7,10 @@ class TestController < ApplicationController
def bootstrap; end
+ def view_office
+
+ end
+
def zip
homeworks_attach_path = []
homework_id = params[:homework_id]
diff --git a/config/routes.rb b/config/routes.rb
index 9a8e71156..109e71c32 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -110,6 +110,7 @@ RedmineApp::Application.routes.draw do
match 'courselist'
match 'zip'
match 'mailer'
+ match 'view_office'
end
##new added by linchun #以发布应用的形式参与竞赛
resources :softapplications do
From b3abf610d9390e66f3991c0bb33d039a8a8c4fa5 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Mon, 1 Jun 2015 23:10:25 +0800
Subject: [PATCH 5/5] add rest_client
---
Gemfile | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/Gemfile b/Gemfile
index c1f7bcbeb..660a7ff49 100644
--- a/Gemfile
+++ b/Gemfile
@@ -6,10 +6,7 @@ unless RUBY_PLATFORM =~ /w32/
gem 'iconv'
end
-source 'http://rubygems.oneapm.com' do
- gem 'oneapm_rpm'
-end
-
+gem 'rest-client'
gem "mysql2", "= 0.3.18"
gem 'redis-rails'
gem 'rubyzip'