Merge branch 'szzh' into develop

This commit is contained in:
sw 2015-04-22 14:54:52 +08:00
commit 00910efebc
12 changed files with 237 additions and 236 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
*.swp *.swp
/config/database.yml /config/database.yml
/config/configuration.yml /config/configuration.yml
/config/additional_environment.rb
/files/* /files/*
/log/* /log/*
/public/tmp/* /public/tmp/*

281
Gemfile
View File

@ -1,140 +1,141 @@
source 'http://ruby.taobao.org' source 'http://ruby.taobao.org'
#source 'http://ruby.sdutlinux.org/' #source 'http://ruby.sdutlinux.org/'
unless RUBY_PLATFORM =~ /w32/ unless RUBY_PLATFORM =~ /w32/
# unix-like only # unix-like only
gem 'iconv' gem 'iconv'
end end
gem 'rubyzip' gem 'redis-rails'
gem 'delayed_job_active_record'#, :group => :production gem 'rubyzip'
gem 'daemons' gem 'delayed_job_active_record'#, :group => :production
gem 'grape', '~> 0.9.0' gem 'daemons'
gem 'grape-entity' gem 'grape', '~> 0.9.0'
gem 'seems_rateable', '~> 1.0.13' gem 'grape-entity'
gem "rails", "3.2.13" gem 'seems_rateable', '~> 1.0.13'
gem "jquery-rails", "~> 2.0.2" gem "rails", "3.2.13"
gem "i18n", "~> 0.6.0" gem "jquery-rails", "~> 2.0.2"
gem 'coderay', '~> 1.1.0' gem "i18n", "~> 0.6.0"
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] gem 'coderay', '~> 1.1.0'
gem "builder", "3.0.0" gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem 'acts-as-taggable-on', '2.4.1' gem "builder", "3.0.0"
gem 'spreadsheet' gem 'acts-as-taggable-on', '2.4.1'
gem 'ruby-ole' gem 'spreadsheet'
#gem 'email_verifier', path: 'lib/email_verifier' gem 'ruby-ole'
gem 'rufus-scheduler' #gem 'email_verifier', path: 'lib/email_verifier'
#gem 'dalli', path: 'lib/dalli-2.7.2' gem 'rufus-scheduler'
gem 'rails_kindeditor',path:'lib/rails_kindeditor' #gem 'dalli', path: 'lib/dalli-2.7.2'
group :development do gem 'rails_kindeditor',path:'lib/rails_kindeditor'
gem 'grape-swagger' group :development do
#gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git' gem 'grape-swagger'
gem 'puma' if RbConfig::CONFIG['host_os'] =~ /linux/ #gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git'
gem 'pry-rails' gem 'puma' if RbConfig::CONFIG['host_os'] =~ /linux/
if RUBY_VERSION >= '2.0.0' gem 'pry-rails'
gem 'pry-byebug' if RUBY_VERSION >= '2.0.0'
else gem 'pry-byebug'
# gem 'pry-debugger' else
end # gem 'pry-debugger'
gem 'pry-stack_explorer' end
gem 'better_errors', '~> 1.1.0' gem 'pry-stack_explorer'
gem 'rack-mini-profiler', '~> 0.9.3' gem 'better_errors', '~> 1.1.0'
end gem 'rack-mini-profiler', '~> 0.9.3'
end
group :test do
gem "shoulda", "~> 3.5.0" group :test do
gem "mocha", "~> 1.1.0" gem "shoulda", "~> 3.5.0"
gem 'capybara', '~> 2.4.1' gem "mocha", "~> 1.1.0"
gem 'nokogiri', '~> 1.6.3' gem 'capybara', '~> 2.4.1'
gem 'factory_girl', '~> 4.4.0' gem 'nokogiri', '~> 1.6.3'
gem 'selenium-webdriver', '~> 2.42.0' gem 'factory_girl', '~> 4.4.0'
gem 'selenium-webdriver', '~> 2.42.0'
gem "faker"
# platforms :mri, :mingw do gem "faker"
# group :rmagick do # platforms :mri, :mingw do
# # RMagick 2 supports ruby 1.9 # group :rmagick do
# # RMagick 1 would be fine for ruby 1.8 but Bundler does not support # # RMagick 2 supports ruby 1.9
# # different requirements for the same gem on different platforms # # RMagick 1 would be fine for ruby 1.8 but Bundler does not support
# gem "rmagick", ">= 2.0.0" # # different requirements for the same gem on different platforms
# end # gem "rmagick", ">= 2.0.0"
#end # end
end #end
end
# Gems used only for assets and not required
# in production environments by default. # Gems used only for assets and not required
group :assets do # in production environments by default.
gem 'sass-rails', '~> 3.2.3' group :assets do
gem 'coffee-rails', '~> 3.2.1' gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby # See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end gem 'uglifier', '>= 1.0.3'
end
# Optional gem for LDAP authentication
group :ldap do # Optional gem for LDAP authentication
gem "net-ldap", "~> 0.3.1" group :ldap do
end gem "net-ldap", "~> 0.3.1"
end
# Optional gem for OpenID authentication
group :openid do # Optional gem for OpenID authentication
gem "ruby-openid", "~> 2.1.4", :require => "openid" group :openid do
gem "rack-openid" gem "ruby-openid", "~> 2.1.4", :require => "openid"
end gem "rack-openid"
end
# Optional gem for exporting the gantt to a PNG file, not supported with jruby
platforms :jruby do # Optional gem for exporting the gantt to a PNG file, not supported with jruby
# jruby-openssl is bundled with JRuby 1.7.0 platforms :jruby do
gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0' # jruby-openssl is bundled with JRuby 1.7.0
gem "activerecord-jdbc-adapter", "1.2.5" gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
end gem "activerecord-jdbc-adapter", "1.2.5"
end
# Include database gems for the adapters found in the database
# configuration file # Include database gems for the adapters found in the database
require 'erb' # configuration file
require 'yaml' require 'erb'
database_file = File.join(File.dirname(__FILE__), "config/database.yml") require 'yaml'
if File.exist?(database_file) database_file = File.join(File.dirname(__FILE__), "config/database.yml")
database_config = YAML::load(ERB.new(IO.read(database_file)).result) if File.exist?(database_file)
adapters = database_config.values.map {|c| c['adapter']}.compact.uniq database_config = YAML::load(ERB.new(IO.read(database_file)).result)
if adapters.any? adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
adapters.each do |adapter| if adapters.any?
case adapter adapters.each do |adapter|
when 'mysql2' case adapter
gem "mysql2", "= 0.3.18", :platforms => [:mri, :mingw] when 'mysql2'
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby gem "mysql2", "= 0.3.18", :platforms => [:mri, :mingw]
when 'mysql' gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw] when 'mysql'
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw]
when /postgresql/ gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw] when /postgresql/
gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
when /sqlite3/ gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby
gem "sqlite3", :platforms => [:mri, :mingw] when /sqlite3/
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby gem "sqlite3", :platforms => [:mri, :mingw]
when /sqlserver/ gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw] when /sqlserver/
gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw] gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw]
else gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw]
warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems") else
end warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
end end
else end
warn("No adapter found in config/database.yml, please configure it first") else
end warn("No adapter found in config/database.yml, please configure it first")
else end
warn("Please configure your config/database.yml first") else
end warn("Please configure your config/database.yml first")
end
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
if File.exists?(local_gemfile) local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v` if File.exists?(local_gemfile)
instance_eval File.read(local_gemfile) puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
end instance_eval File.read(local_gemfile)
end
# Load plugins' Gemfiles
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file| # Load plugins' Gemfiles
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v` Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
instance_eval File.read(file) puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
end instance_eval File.read(file)
end

View File

@ -332,7 +332,7 @@ class AccountController < ApplicationController
token = Token.create(:user => user, :action => 'autologin') token = Token.create(:user => user, :action => 'autologin')
cookie_options = { cookie_options = {
:value => token.value, :value => token.value,
:expires => 1.year.from_now, :expires => 7.days.from_now,
:path => (Redmine::Configuration['autologin_cookie_path'] || '/'), :path => (Redmine::Configuration['autologin_cookie_path'] || '/'),
:secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false), :secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false),
:httponly => true :httponly => true

View File

@ -68,7 +68,7 @@
<td align="left"> <td align="left">
<% if Setting.autologin? %> <% if Setting.autologin? %>
<label for="autologin"> <label for="autologin">
<%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= check_box_tag 'autologin', 1, true, :tabindex => 4 %>
<%= l(:label_stay_logged_in) %> <%= l(:label_stay_logged_in) %>
</label> </label>
<% end %> <% end %>

View File

@ -114,6 +114,9 @@ $(function(){
function f_submit() 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(); $("#new_memo").submit();
} }
@ -166,8 +169,8 @@ function cookieget(n)
<div class="custom_service"> <div class="custom_service">
<% get_memo %> <% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> <%= 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 :subject,:required => true , :value => l(:label_feedback_value) %>
<%= f.hidden_field :content,:id => 'hidden', :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" %> <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a> <a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a>
<% end %> <% end %>

View File

@ -13,8 +13,8 @@
<div class="custom_service"> <div class="custom_service">
<% get_memo %> <% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> <%= 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 :subject,:required => true , :value => l(:label_feedback_value) %>
<%= f.hidden_field :content, :required => true , :value => l(:label_feedback_value) %> <%= f.text_area :content,:class => "opnionText" , :placeholder => l(:label_feedback_tips) %>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"> <a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();">
<%= l(:label_submit)%> <%= l(:label_submit)%>
</a> </a>

View File

@ -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'

View File

@ -1,77 +1,75 @@
require File.expand_path('../boot', __FILE__) require File.expand_path('../boot', __FILE__)
require 'rails/all' require 'rails/all'
require 'sprockets/railtie' require 'sprockets/railtie'
if defined?(Bundler) if defined?(Bundler)
# If you precompile assets before deploying to production, use this line # If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test))) Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line # If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env) # Bundler.require(:default, :assets, Rails.env)
end end
module RedmineApp module RedmineApp
class Application < Rails::Application class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here. # Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers # Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded. # -- all .rb files in that directory are automatically loaded.
#verifier if email is real #verifier if email is real
config.generators do |g| config.generators do |g|
g.test_framework :rspec, g.test_framework :rspec,
fixtures: true, fixtures: true,
view_specs: false, view_specs: false,
helper_specs: false, helper_specs: false,
routing_specs: false, routing_specs: false,
controller_specs: true, controller_specs: true,
request_specs: false request_specs: false
g.fixture_replacement :factory_girl, dir: "spec/factories" g.fixture_replacement :factory_girl, dir: "spec/factories"
end end
# Custom directories with classes and modules you want to be autoloadable. # Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += %W(#{config.root}/lib) config.autoload_paths += %W(#{config.root}/lib)
# Only load the plugins named here, in the order given (default is alphabetical). # Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named. # :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ] # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running. # Activate observers that should always be running.
config.active_record.observers = :journals_for_message_observer, :issue_observer, :journal_observer, :wiki_content_observer config.active_record.observers = :journals_for_message_observer, :issue_observer, :journal_observer, :wiki_content_observer
config.active_record.store_full_sti_class = true config.active_record.store_full_sti_class = true
config.active_record.default_timezone = :local config.active_record.default_timezone = :local
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)' # config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de # config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9. # Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8" config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file. # Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password] config.filter_parameters += [:password]
# Enable the asset pipeline # Enable the asset pipeline
config.assets.enabled = false config.assets.enabled = false
# Version of your assets, change this if you want to expire all your assets # Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0' config.assets.version = '1.0'
config.action_mailer.perform_deliveries = false config.action_mailer.perform_deliveries = false
# Do not include all helpers # Do not include all helpers
config.action_controller.include_all_helpers = false 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'))
if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb')) end
instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
end end
end
end
end

View File

@ -19,7 +19,12 @@ RedmineApp::Application.configure do
# Full error reports are disabled and caching is turned on # Full error reports are disabled and caching is turned on
config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly
config.action_controller.perform_caching = true 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 # Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com" # config.action_controller.asset_host = "http://assets.example.com"

View File

@ -347,7 +347,7 @@ en:
label_feedback_tips: "Anything you want to say roar it here ~~" label_feedback_tips: "Anything you want to say roar it here ~~"
label_technical_support: "Support: " 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_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"
# #
# #

View File

@ -354,7 +354,7 @@ zh:
label_feedback_tips: "有什么想说的,尽管来咆哮吧~~" label_feedback_tips: "有什么想说的,尽管来咆哮吧~~"
label_technical_support: "技术支持:" label_technical_support: "技术支持:"
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!" label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
label_feedback_value: "该贴来自用户反馈" label_feedback_value: "用户意见反馈"

View File

@ -82,5 +82,8 @@ $(function(){
function f_submit() function f_submit()
{ {
var subject = $("#memo_subject").val();
var content = $("#memo_content").val();
$("#memo_subject").val(subject+""+ content.substr(0,18));
$("#new_memo").submit(); $("#new_memo").submit();
} }