From d2dd77612b7ba4bde2569ddb49d30d8337ca152e Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Wed, 22 Apr 2015 12:42:22 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E5=B0=86=E7=99=BB=E5=BD=95=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E5=80=BC=E6=94=B9=E4=B8=BA=E8=87=AA=E5=8A=A8=E7=99=BB?=
=?UTF-8?q?=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/account_controller.rb | 2 +-
app/views/account/login.html.erb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index f8d0f5dd1..22db3d5b4 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -332,7 +332,7 @@ class AccountController < ApplicationController
token = Token.create(:user => user, :action => 'autologin')
cookie_options = {
:value => token.value,
- :expires => 1.year.from_now,
+ :expires => 7.days.from_now,
:path => (Redmine::Configuration['autologin_cookie_path'] || '/'),
:secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false),
:httponly => true
diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb
index 4175282b3..bb289eb03 100644
--- a/app/views/account/login.html.erb
+++ b/app/views/account/login.html.erb
@@ -68,7 +68,7 @@
<% if Setting.autologin? %>
<% end %>
From 336dba414e9d5c049d43f942a164c8db225b078c Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Wed, 22 Apr 2015 13:01:33 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E4=B8=BAredis=E5=AD=98=E5=82=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 +
Gemfile | 1 +
config/additional_environment.rb | 10 ----------
config/application.rb | 2 --
config/environments/production.rb | 7 ++++++-
5 files changed, 8 insertions(+), 13 deletions(-)
delete mode 100644 config/additional_environment.rb
diff --git a/.gitignore b/.gitignore
index a6ee997aa..96788ad9a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
*.swp
/config/database.yml
/config/configuration.yml
+/config/additional_environment.rb
/files/*
/log/*
/public/tmp/*
diff --git a/Gemfile b/Gemfile
index 679e0a5b2..d5fe6c581 100644
--- a/Gemfile
+++ b/Gemfile
@@ -6,6 +6,7 @@ unless RUBY_PLATFORM =~ /w32/
gem 'iconv'
end
+gem 'redis-rails'
gem 'rubyzip'
gem 'delayed_job_active_record'#, :group => :production
gem 'daemons'
diff --git a/config/additional_environment.rb b/config/additional_environment.rb
deleted file mode 100644
index 6654da90f..000000000
--- a/config/additional_environment.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copy this file to additional_environment.rb and add any statements
-# that need to be passed to the Rails::Initializer. `config` is
-# available in this context.
-#
-# Example:
-#
-# config.log_level = :debug
-# ...
-#
-#config.relative_url_root = '/socialforge'
diff --git a/config/application.rb b/config/application.rb
index 05160d03e..57ae436cb 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -67,8 +67,6 @@ module RedmineApp
# Do not include all helpers
config.action_controller.include_all_helpers = false
- config.session_store :cookie_store, :key => '_redmine_session'
-
if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 160e0b8b0..63931fa33 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -19,7 +19,12 @@ RedmineApp::Application.configure do
# Full error reports are disabled and caching is turned on
config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly
config.action_controller.perform_caching = true
- config.cache_store = :file_store, "#{Rails.root }/files/cache_store/"
+
+ # to additional_environment.rb
+ # config.cache_store = :file_store, "#{Rails.root }/files/cache_store/"
+ # config.cache_store = :redis_store, 'redis://localhost:6379/0/cache', { expires_in: 90.minutes }
+ #
+
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
From 21f08830df33ddc6a6117765bcbf860e6f48d879 Mon Sep 17 00:00:00 2001
From: whimlex
Date: Wed, 22 Apr 2015 14:35:04 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_base_feedback.html.erb | 7 +++++--
app/views/layouts/_new_feedback.html.erb | 4 ++--
config/locales/commons/en.yml | 2 +-
config/locales/commons/zh.yml | 2 +-
public/javascripts/feedback.js | 3 +++
5 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb
index 19892e841..7105aff47 100644
--- a/app/views/layouts/_base_feedback.html.erb
+++ b/app/views/layouts/_base_feedback.html.erb
@@ -114,6 +114,9 @@ $(function(){
function f_submit()
{
+ var subject = $("#memo_subject").val();
+ var content = $("#memo_content_1").val();
+ $("#memo_subject").val(subject+":"+ content.substr(0,18));
$("#new_memo").submit();
}
@@ -166,8 +169,8 @@ function cookieget(n)
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
- <%= f.text_area :subject, :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
- <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
+ <%= f.hidden_field :subject,:required => true , :value => l(:label_feedback_value) %>
+ <%= f.text_area :content,:class => "opnionText",:id=>"memo_content_1" ,:placeholder => l(:label_feedback_tips) %>
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
<%= l(:label_submit)%>
<% end %>
diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb
index 32afb4e5c..e30181612 100644
--- a/app/views/layouts/_new_feedback.html.erb
+++ b/app/views/layouts/_new_feedback.html.erb
@@ -13,8 +13,8 @@
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
- <%= f.text_area :subject, :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
- <%= f.hidden_field :content, :required => true , :value => l(:label_feedback_value) %>
+ <%= f.hidden_field :subject,:required => true , :value => l(:label_feedback_value) %>
+ <%= f.text_area :content,:class => "opnionText" , :placeholder => l(:label_feedback_tips) %>
<%= l(:label_submit)%>
diff --git a/config/locales/commons/en.yml b/config/locales/commons/en.yml
index 3c2c63654..5eb92f07e 100644
--- a/config/locales/commons/en.yml
+++ b/config/locales/commons/en.yml
@@ -347,7 +347,7 @@ en:
label_feedback_tips: "Anything you want to say, roar it here ~~"
label_technical_support: "Support: "
label_feedback_success: "Your comments have been sent to the public bar in the home page, thanks for your support!"
- label_feedback_value: "The post comes from user feedback box!"
+ label_feedback_value: "User feedback"
#
#
diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml
index dae2a9741..c20e5799b 100644
--- a/config/locales/commons/zh.yml
+++ b/config/locales/commons/zh.yml
@@ -354,7 +354,7 @@ zh:
label_feedback_tips: "有什么想说的,尽管来咆哮吧~~"
label_technical_support: "技术支持:"
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
- label_feedback_value: "该贴来自用户反馈!"
+ label_feedback_value: "用户意见反馈"
diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js
index 7ed063b75..a3707b312 100644
--- a/public/javascripts/feedback.js
+++ b/public/javascripts/feedback.js
@@ -82,5 +82,8 @@ $(function(){
function f_submit()
{
+ var subject = $("#memo_subject").val();
+ var content = $("#memo_content").val();
+ $("#memo_subject").val(subject+":"+ content.substr(0,18));
$("#new_memo").submit();
}
\ No newline at end of file
|