- <%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), user_path(contest.author), :class => "avatar") %>
+
+ <% unless contest.author.nil? %>
+ <%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), user_path(contest.author), :class => "avatar") %>
+ <% end %>
+
- <%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>: <%= link_to(contest.name, show_contest_contest_path(contest), :class => 'bid_path', :target => "_blank") %>
+
+ <% unless contest.author.nil? %>
+ <%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>:
+ <% end %>
+ <%= link_to(contest.name, show_contest_contest_path(contest), :class => 'bid_path', :target => "_blank") %>
diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb
index 0bbb0ddd4..2b8f98494 100644
--- a/app/views/forums/_forum_list.html.erb
+++ b/app/views/forums/_forum_list.html.erb
@@ -3,7 +3,11 @@
<% if forums.any? %>
<% forums.each do |forum| %>
-
<%= link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator) %>
+
+ <% unless forum.creator.nil? %>
+ <%= link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator) %>
+ <% end %>
+
<%= link_to h(forum.name), forum_path(forum) %>
<%= forum.description%>
From 98ddd6940db34d784060734b70122beddbee3f1a Mon Sep 17 00:00:00 2001
From: z9hang
Date: Mon, 14 Jul 2014 09:31:55 +0800
Subject: [PATCH 15/68] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/first_page.rb | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/models/first_page.rb b/app/models/first_page.rb
index fcb76972c..b284c8fdc 100644
--- a/app/models/first_page.rb
+++ b/app/models/first_page.rb
@@ -1,4 +1,3 @@
class FirstPage < ActiveRecord::Base
attr_accessible :description, :title, :web_title,:page_type
end
- l
\ No newline at end of file
From fd5747f4dc558eb9dd27c733c4b433da97e4faf0 Mon Sep 17 00:00:00 2001
From: yanxd
Date: Mon, 14 Jul 2014 10:27:54 +0800
Subject: [PATCH 16/68] test 3-framework
---
Gemfile | 6 ++-
Gemfile.lock | 53 ++++++++++++++++++-
Guardfile | 45 ++++++++++++++++
app/models/setting.rb | 2 +-
.../test/test_helper.rb | 2 +-
test/integration/account_test.rb | 2 +-
test/integration/routing/courses_test.rb | 27 ++++++++++
.../scm/adapters/bazaar_adapter_test.rb | 2 +-
.../redmine/scm/adapters/cvs_adapter_test.rb | 2 +-
.../scm/adapters/darcs_adapter_test.rb | 2 +-
.../redmine/scm/adapters/git_adapter_test.rb | 2 +-
.../scm/adapters/mercurial_adapter_test.rb | 2 +-
.../scm/adapters/subversion_adapter_test.rb | 2 +-
13 files changed, 137 insertions(+), 12 deletions(-)
create mode 100644 Guardfile
create mode 100644 test/integration/routing/courses_test.rb
diff --git a/Gemfile b/Gemfile
index 634af9683..4d9e788d8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,4 @@
-source 'https://rubygems.org'
+source 'https://ruby.taobao.org'
unless RUBY_PLATFORM =~ /w32/
# unix-like only
@@ -19,6 +19,9 @@ gem 'acts-as-taggable-on', '2.4.1'
group :development do
gem 'better_errors', path: 'lib/better_errors'
gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler'
+ gem "guard-rails"
+ gem 'guard-minitest'
+ gem 'guard-spork'
if ENV['PRY']
gem 'pry'
gem 'pry-nav'
@@ -26,7 +29,6 @@ group :development do
end
group :test do
- # shoulda的版本做了改动
#gem "shoulda", "~> 3.3.2"
gem "shoulda", "> 3.3.2"
gem "mocha", "~> 0.13.3"
diff --git a/Gemfile.lock b/Gemfile.lock
index d30eb7bc4..78b643e44 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -19,7 +19,7 @@ PATH
rails
GEM
- remote: https://rubygems.org/
+ remote: https://ruby.taobao.org/
remote: https://rubygems.org/
specs:
actionmailer (3.2.13)
@@ -60,6 +60,8 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 1.0.0)
+ celluloid (0.15.2)
+ timers (~> 1.1.0)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
climate_control (0.0.3)
@@ -77,7 +79,24 @@ GEM
erubis (2.7.0)
execjs (2.0.2)
fastercsv (1.5.0)
+ ffi (1.9.3)
ffi (1.9.3-x86-mingw32)
+ formatador (0.2.5)
+ guard (2.6.1)
+ formatador (>= 0.2.4)
+ listen (~> 2.7)
+ lumberjack (~> 1.0)
+ pry (>= 0.9.12)
+ thor (>= 0.18.1)
+ guard-minitest (2.3.1)
+ guard (~> 2.0)
+ minitest (>= 3.0)
+ guard-rails (0.5.2)
+ guard (~> 2.0)
+ guard-spork (1.5.1)
+ childprocess (>= 0.2.3)
+ guard (>= 1.1)
+ spork (>= 0.8.4)
hike (1.2.3)
htmlentities (4.3.2)
i18n (0.6.1)
@@ -89,16 +108,25 @@ GEM
kaminari (0.16.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
+ listen (2.7.9)
+ celluloid (>= 0.15.2)
+ rb-fsevent (>= 0.9.3)
+ rb-inotify (>= 0.9)
+ lumberjack (1.0.9)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.4)
+ method_source (0.8.2)
mime-types (1.23)
+ minitest (5.4.0)
mocha (0.13.3)
metaclass (~> 0.0.1)
multi_json (1.7.6)
+ mysql2 (0.3.11)
mysql2 (0.3.11-x86-mingw32)
net-ldap (0.3.1)
+ nokogiri (1.5.11)
nokogiri (1.5.11-x86-mingw32)
paperclip (3.5.4)
activemodel (>= 3.0.0)
@@ -106,6 +134,17 @@ GEM
cocaine (~> 0.5.3)
mime-types
polyglot (0.3.3)
+ pry (0.9.12.6)
+ coderay (~> 1.0)
+ method_source (~> 0.8)
+ slop (~> 3.4)
+ pry (0.9.12.6-x86-mingw32)
+ coderay (~> 1.0)
+ method_source (~> 0.8)
+ slop (~> 3.4)
+ win32console (~> 1.3)
+ pry-nav (0.2.3)
+ pry (~> 0.9.10)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
@@ -134,6 +173,9 @@ GEM
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.3.2)
+ rb-fsevent (0.9.4)
+ rb-inotify (0.9.5)
+ ffi (>= 0.5.0)
rdoc (3.12.2)
json (~> 1.4)
rich (1.4.6)
@@ -163,6 +205,8 @@ GEM
shoulda-context (1.2.1)
shoulda-matchers (2.6.1)
activesupport (>= 3.0.0)
+ slop (3.5.0)
+ spork (0.9.2)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
@@ -170,6 +214,7 @@ GEM
tilt (~> 1.1, != 1.3.0)
thor (0.18.1)
tilt (1.4.1)
+ timers (1.1.0)
treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
@@ -178,6 +223,7 @@ GEM
execjs (>= 0.3.0)
json (>= 1.8.0)
websocket (1.0.7)
+ win32console (1.3.2-x86-mingw32)
xpath (1.0.0)
nokogiri (~> 1.3)
@@ -194,6 +240,9 @@ DEPENDENCIES
coderay (~> 1.0.6)
coffee-rails (~> 3.2.1)
fastercsv (~> 1.5.0)
+ guard-minitest
+ guard-rails
+ guard-spork
htmlentities
i18n (~> 0.6.0)
jquery-rails (~> 2.0.2)
@@ -203,6 +252,8 @@ DEPENDENCIES
net-ldap (~> 0.3.1)
nokogiri (< 1.6.0)
paperclip (~> 3.5.4)
+ pry
+ pry-nav
rack-mini-profiler!
rack-openid
rails (= 3.2.13)
diff --git a/Guardfile b/Guardfile
new file mode 100644
index 000000000..c30f4195e
--- /dev/null
+++ b/Guardfile
@@ -0,0 +1,45 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'rails' do
+ watch('Gemfile.lock')
+ watch(%r{^(config|lib)/.*})
+end
+
+
+guard :minitest, :drb => true, test_folders: 'test/unit', test_file_patterns: '*_test.rb' do
+ # with Minitest::Unit
+ watch(%r{^test/(.*)\/?test_(.*)\.rb$})
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
+
+ # with Minitest::Spec
+ # watch(%r{^spec/(.*)_spec\.rb$})
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ # watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
+
+ # Rails 4
+ # watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
+ # watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
+ # watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
+ # watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
+ # watch(%r{^test/.+_test\.rb$})
+ # watch(%r{^test/test_helper\.rb$}) { 'test' }
+
+ # Rails < 4
+ watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
+ watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
+ watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
+end
+
+guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
+ watch('config/application.rb')
+ watch('config/environment.rb')
+ watch('config/environments/test.rb')
+ watch(%r{^config/initializers/.+\.rb$})
+ watch('Gemfile.lock')
+ watch('spec/spec_helper.rb') { :rspec }
+ watch('test/test_helper.rb') { :test_unit }
+ watch(%r{features/support/}) { :cucumber }
+end
diff --git a/app/models/setting.rb b/app/models/setting.rb
index 583d034df..3f11ef7c2 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -163,7 +163,7 @@ class Setting < ActiveRecord::Base
end
# fixed domain url in development. tantantan's bug
- if Rails.env.development?
+ if Rails.env.development? || Rails.env.test?
methods.map do |m|
define_singleton_method m do; nil; end if m.to_s =~ /([a-zA-Z]+_domain)$/
end
diff --git a/lib/plugins/open_id_authentication/test/test_helper.rb b/lib/plugins/open_id_authentication/test/test_helper.rb
index 43216e1ef..cb76ceddc 100644
--- a/lib/plugins/open_id_authentication/test/test_helper.rb
+++ b/lib/plugins/open_id_authentication/test/test_helper.rb
@@ -8,7 +8,7 @@ gem 'actionpack'
require 'action_controller'
gem 'mocha'
-require 'mocha'
+require 'mocha/setup'
gem 'ruby-openid'
require 'openid'
diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb
index 7562bcf7c..fcb3ce4f8 100644
--- a/test/integration/account_test.rb
+++ b/test/integration/account_test.rb
@@ -18,7 +18,7 @@
require File.expand_path('../../test_helper', __FILE__)
begin
- require 'mocha'
+ require 'mocha/setup'
rescue
# Won't run some tests
end
diff --git a/test/integration/routing/courses_test.rb b/test/integration/routing/courses_test.rb
new file mode 100644
index 000000000..5554cb03d
--- /dev/null
+++ b/test/integration/routing/courses_test.rb
@@ -0,0 +1,27 @@
+# Redmine - project management software
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require File.expand_path('../../../test_helper', __FILE__)
+
+class RoutingProjectsTest < ActionController::IntegrationTest
+ def test_courses
+ assert_routing(
+ { :method => 'get', :path => "/courses" },
+ { :controller => 'projects', :action => 'index' }
+ )
+ end
+end
diff --git a/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb
index d69da033f..3e3f6ca88 100644
--- a/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../../../../../test_helper', __FILE__)
begin
- require 'mocha'
+ require 'mocha/setup'
class BazaarAdapterTest < ActiveSupport::TestCase
REPOSITORY_PATH = Rails.root.join('tmp/test/bazaar_repository').to_s
diff --git a/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
index 6b2a804e0..cddedf871 100644
--- a/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../../../../../test_helper', __FILE__)
begin
- require 'mocha'
+ require 'mocha/setup'
class CvsAdapterTest < ActiveSupport::TestCase
REPOSITORY_PATH = Rails.root.join('tmp/test/cvs_repository').to_s
diff --git a/test/unit/lib/redmine/scm/adapters/darcs_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/darcs_adapter_test.rb
index 5b689001a..f5a642689 100644
--- a/test/unit/lib/redmine/scm/adapters/darcs_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/darcs_adapter_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../../../../../test_helper', __FILE__)
begin
- require 'mocha'
+ require 'mocha/setup'
class DarcsAdapterTest < ActiveSupport::TestCase
REPOSITORY_PATH = Rails.root.join('tmp/test/darcs_repository').to_s
diff --git a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
index 946ea4bfa..443b900bf 100644
--- a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../../../../../test_helper', __FILE__)
begin
- require 'mocha'
+ require 'mocha/setup'
class GitAdapterTest < ActiveSupport::TestCase
REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s
diff --git a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
index c23e7debd..ee31ff030 100644
--- a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../../../../../test_helper', __FILE__)
begin
- require 'mocha'
+ require 'mocha/setup'
class MercurialAdapterTest < ActiveSupport::TestCase
HELPERS_DIR = Redmine::Scm::Adapters::MercurialAdapter::HELPERS_DIR
diff --git a/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb
index 8bf08f011..dba1a6d43 100644
--- a/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb
@@ -18,7 +18,7 @@
require File.expand_path('../../../../../../test_helper', __FILE__)
begin
- require 'mocha'
+ require 'mocha/setup'
class SubversionAdapterTest < ActiveSupport::TestCase
From 87b623bc51e9680b60b1c766b6aaec75a5619451 Mon Sep 17 00:00:00 2001
From: nwb
Date: Mon, 14 Jul 2014 10:44:07 +0800
Subject: [PATCH 17/68] =?UTF-8?q?1.=E6=96=87=E6=A1=A3=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E5=AF=86=E7=BA=A7=E8=AE=BE=E7=BD=AE=202.=E6=96=B0=E5=BB=BA?=
=?UTF-8?q?=E6=96=87=E6=A1=A3=E3=80=81=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?=
=?UTF-8?q?=E8=A7=86=E5=9B=BE=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/document.rb | 2 +-
app/views/documents/_form.html.erb | 5 ++++-
config/locales/en.yml | 1 +
config/locales/zh.yml | 1 +
...140714021812_add_is_public_to_documents.rb | 5 +++++
db/schema.rb | 22 +++----------------
6 files changed, 15 insertions(+), 21 deletions(-)
create mode 100644 db/migrate/20140714021812_add_is_public_to_documents.rb
diff --git a/app/models/document.rb b/app/models/document.rb
index 7c2730682..661949ca9 100644
--- a/app/models/document.rb
+++ b/app/models/document.rb
@@ -39,7 +39,7 @@ class Document < ActiveRecord::Base
includes(:project).where(Project.allowed_to_condition(args.shift || User.current, :view_documents, *args))
}
- safe_attributes 'category_id', 'title', 'description'
+ safe_attributes 'category_id', 'title', 'description','is_public'
def visible?(user=User.current)
!user.nil? && user.allowed_to?(:view_documents, project)
diff --git a/app/views/documents/_form.html.erb b/app/views/documents/_form.html.erb
index 53d8fc3bb..72361b9ab 100644
--- a/app/views/documents/_form.html.erb
+++ b/app/views/documents/_form.html.erb
@@ -1,7 +1,10 @@
<%= error_messages_for @document %>
-
<%= f.select :category_id, DocumentCategory.active.collect {|c| [c.name, c.id]} %>
+
<%= f.select :category_id, DocumentCategory.active.collect {|c| [c.name, c.id]} %>
+
<%= f.check_box :is_public, :style => "margin-left:10px;" %>
+ <%= l(:label_document_public_info) %>
+
<%= f.text_field :title, :required => true, :size => 60 %>
<%= f.text_area :description, :cols => 60, :rows => 15, :class => 'wiki-edit' %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 6566564c9..db673c69c 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -537,6 +537,7 @@ en:
label_document_new: New document
label_document_plural: Documents
label_document_added: Document added
+ label_document_public_info: "If you don't choose public, only the project's members can see the document."
label_role: Role
label_role_plural: Roles
label_role_new: New role
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 1be9e7b20..36d89da10 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -533,6 +533,7 @@ zh:
label_document_new: 新建文档
label_document_plural: 文档
label_document_added: 文档已添加
+ label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。)
label_role: 角色
label_role_plural: 角色
label_role_new: 新建角色
diff --git a/db/migrate/20140714021812_add_is_public_to_documents.rb b/db/migrate/20140714021812_add_is_public_to_documents.rb
new file mode 100644
index 000000000..2c21c7d03
--- /dev/null
+++ b/db/migrate/20140714021812_add_is_public_to_documents.rb
@@ -0,0 +1,5 @@
+class AddIsPublicToDocuments < ActiveRecord::Migration
+ def change
+ add_column :documents, :is_public, :integer,:default => 1
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index f63f3cb46..109c1f189 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,11 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-<<<<<<< HEAD
-ActiveRecord::Schema.define(:version => 20140710030426) do
-=======
-ActiveRecord::Schema.define(:version => 20140708023356) do
->>>>>>> 056f86caad29ca95632d9da9e1e616cd00e2349a
+ActiveRecord::Schema.define(:version => 20140714021812) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -383,6 +379,7 @@ ActiveRecord::Schema.define(:version => 20140708023356) do
t.text "description"
t.datetime "created_on"
t.integer "user_id", :default => 0
+ t.integer "is_public", :default => 1
end
add_index "documents", ["category_id"], :name => "index_documents_on_category_id"
@@ -799,7 +796,7 @@ ActiveRecord::Schema.define(:version => 20140708023356) do
end
create_table "relative_memos", :force => true do |t|
- t.integer "osp_id", :null => false
+ t.integer "osp_id"
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :null => false
@@ -836,19 +833,6 @@ ActiveRecord::Schema.define(:version => 20140708023356) 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 3aab1b172c88beba760d149f6ba3fceeb4d9f5b2 Mon Sep 17 00:00:00 2001
From: z9hang
Date: Mon, 14 Jul 2014 11:28:29 +0800
Subject: [PATCH 18/68] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=89=A7=E8=A1=8C?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB=E6=97=B6=E7=9A=84=E2=80=98?=
=?UTF-8?q?page=5Ftype=3D=E2=80=99=20undefine=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/migrate/20140710071720_create_first_pages.rb | 3 +++
db/migrate/20140710095123_add_cloumn_to_first_page.rb | 8 ++++----
db/migrate/20140711010124_alt_column_name.rb | 2 +-
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/db/migrate/20140710071720_create_first_pages.rb b/db/migrate/20140710071720_create_first_pages.rb
index fa7d01601..c33283a06 100644
--- a/db/migrate/20140710071720_create_first_pages.rb
+++ b/db/migrate/20140710071720_create_first_pages.rb
@@ -5,6 +5,7 @@ class CreateFirstPages < ActiveRecord::Migration
t.string :web_title
t.string :title
t.string :description
+ t.string :page_type
t.timestamps
end
@@ -12,6 +13,8 @@ class CreateFirstPages < ActiveRecord::Migration
fp.web_title = "Trustie - 为大学生技术创新筑巢"
fp.title = "Trustie在线项目托管平台"
fp.description = "面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。"
+ fp.page_type = "project"
+
fp.save
end
end
diff --git a/db/migrate/20140710095123_add_cloumn_to_first_page.rb b/db/migrate/20140710095123_add_cloumn_to_first_page.rb
index 6720a8aa4..8642f08a2 100644
--- a/db/migrate/20140710095123_add_cloumn_to_first_page.rb
+++ b/db/migrate/20140710095123_add_cloumn_to_first_page.rb
@@ -1,9 +1,9 @@
class AddCloumnToFirstPage < ActiveRecord::Migration
def change
- add_column :first_pages,:type,:string
+ #add_column :first_pages,:type,:string
- fr = FirstPage.all.first
- fr.type = "project"
- fr.save
+ #fr = FirstPage.all.first
+ #fr.type = "project"
+ #fr.save
end
end
diff --git a/db/migrate/20140711010124_alt_column_name.rb b/db/migrate/20140711010124_alt_column_name.rb
index 24b784765..50a531d54 100644
--- a/db/migrate/20140711010124_alt_column_name.rb
+++ b/db/migrate/20140711010124_alt_column_name.rb
@@ -1,5 +1,5 @@
class AltColumnName < ActiveRecord::Migration
def change
- rename_column :first_pages,:type,:page_type
+ #rename_column :first_pages,:type,:page_type
end
end
From 0031f90c649f95ee856a3eae67971f654f77f15d Mon Sep 17 00:00:00 2001
From: nwb
Date: Mon, 14 Jul 2014 11:31:24 +0800
Subject: [PATCH 19/68] =?UTF-8?q?1.=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=A7=81=E6=9C=89=E7=9A=84=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E3=80=81=E6=96=87=E6=A1=A3=E8=BF=9B=E8=A1=8C=E6=9D=83=E9=99=90?=
=?UTF-8?q?=E5=88=A4=E6=96=AD=202.=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=A7=81=E6=9C=89=E7=9A=84=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E3=80=81=E6=96=87=E6=A1=A3=E8=BF=9B=E8=A1=8C=E6=9D=83=E9=99=90?=
=?UTF-8?q?=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 8 +++++++-
app/controllers/documents_controller.rb | 9 +++++++++
app/controllers/projects_controller.rb | 10 ++++++++--
app/models/attachment.rb | 5 ++++-
app/models/document.rb | 3 ++-
.../lib/acts_as_activity_provider.rb | 7 ++++++-
lib/redmine/activity/fetcher.rb | 2 ++
7 files changed, 38 insertions(+), 6 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 27851e435..a38d9f9c8 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -630,7 +630,13 @@ class CoursesController < ApplicationController
:with_subprojects => false,
:author => @author)
@activity.scope_select {|t| has["show_#{t}"]}
- events = @activity.events(@date_from, @date_to)
+ # modify by nwb
+ # 添加私密性判断
+ if User.current.member_of_course?(@course)|| User.current.admin?
+ events = @activity.events(@date_from, @date_to)
+ else
+ events = @activity.events(@date_from, @date_to, :is_public => 1)
+ end
@offset, @limit = api_offset_and_limit({:limit => 10})
@events_count = events.count
diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb
index 464c4a2b8..89bd9dc92 100644
--- a/app/controllers/documents_controller.rb
+++ b/app/controllers/documents_controller.rb
@@ -23,6 +23,7 @@ class DocumentsController < ApplicationController
before_filter :find_model_object, :except => [:index, :new, :create]
before_filter :find_project_from_association, :except => [:index, :new, :create]
before_filter :authorize , :except => [:index]#Added by young
+ before_filter :authorize_document
helper :attachments
@@ -100,4 +101,12 @@ class DocumentsController < ApplicationController
end
redirect_to document_path(@document)
end
+
+ # 权限判断
+ # add by nwb
+ def authorize_document
+ if !(User.current.admin? || User.current.member_of?(@project) || @document.is_public==1)
+ render_403 :message => :notice_not_authorized
+ end
+ end
end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index a840ee934..1d3f0ec42 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -697,8 +697,14 @@ class ProjectsController < ApplicationController
@activity.scope_select {|t| !has["show_#{t}"].nil?}
# logger.debug "=========================================#{@activity.scope}"
# @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
- #Added by young
- events = @activity.events(@date_from, @date_to)
+
+ # modify by nwb
+ # 添加私密性判断
+ if User.current.member_of?(@project)|| User.current.admin?
+ events = @activity.events(@date_from, @date_to)
+ else
+ events = @activity.events(@date_from, @date_to, :is_public => 1)
+ end
@offset, @limit = api_offset_and_limit({:limit => 10})
@events_count = events.count
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 0eb3e7666..b301ba73c 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -39,19 +39,22 @@ class Attachment < ActiveRecord::Base
#课程资源文件
acts_as_activity_provider :type => 'course_files',
+ :is_public => 'attachments.is_public',
:permission => :view_files,
:author_key => :author_id,
:find_options => {:select => "#{Attachment.table_name}.*",
:joins => "LEFT JOIN #{Course.table_name} ON ( #{Attachment.table_name}.container_type='Course' AND #{Attachment.table_name}.container_id = #{Course.table_name}.id )"}
acts_as_activity_provider :type => 'files',
+ :is_public => 'attachments.is_public',
:permission => :view_files,
:author_key => :author_id,
- :find_options => {:select => "#{Attachment.table_name}.*",
+ :find_options => { :select => "#{Attachment.table_name}.*",
:joins => "LEFT JOIN #{Version.table_name} ON #{Attachment.table_name}.container_type='Version' AND #{Version.table_name}.id = #{Attachment.table_name}.container_id " +
"LEFT JOIN #{Project.table_name} ON #{Version.table_name}.project_id = #{Project.table_name}.id OR ( #{Attachment.table_name}.container_type='Project' AND #{Attachment.table_name}.container_id = #{Project.table_name}.id )"}
acts_as_activity_provider :type => 'documents',
+ :is_public => 'documents.is_public',
:permission => :view_documents,
:author_key => :author_id,
:find_options => {:select => "#{Attachment.table_name}.*",
diff --git a/app/models/document.rb b/app/models/document.rb
index 661949ca9..5cfce896b 100644
--- a/app/models/document.rb
+++ b/app/models/document.rb
@@ -30,7 +30,8 @@ class Document < ActiveRecord::Base
acts_as_event :title => Proc.new {|o| "#{l(:label_document)}: #{o.title}"},
:author => Proc.new {|o| o.attachments.reorder("#{Attachment.table_name}.created_on ASC").first.try(:author) },
:url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.id}}
- acts_as_activity_provider :find_options => {:include => :project}
+ acts_as_activity_provider :find_options => {:include => :project},
+ :is_public => 'documents.is_public'
validates_presence_of :project, :title, :category
validates_length_of :title, :maximum => 60
diff --git a/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb b/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
index 3875d5c04..e671c3e22 100644
--- a/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
+++ b/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
@@ -29,7 +29,7 @@ module Redmine
send :include, Redmine::Acts::ActivityProvider::InstanceMethods
end
- options.assert_valid_keys(:type, :permission, :timestamp, :author_key, :find_options, :func)
+ options.assert_valid_keys(:type, :permission, :timestamp, :author_key, :find_options, :func,:is_public)
self.activity_provider_options ||= {}
# One model can provide different event types
@@ -65,6 +65,11 @@ module Redmine
scope = scope.scoped(:conditions => ["#{provider_options[:author_key]} = ?", options[:author].id])
end
+ # add by nwb
+ if options[:is_public] && !provider_options[:is_public].nil?
+ scope = scope.scoped(:conditions => ["#{provider_options[:is_public]} = ?", options[:is_public]])
+ end
+
if options[:limit]
# id and creation time should be in same order in most cases
scope = scope.scoped(:order => "#{table_name}.id DESC", :limit => options[:limit])
diff --git a/lib/redmine/activity/fetcher.rb b/lib/redmine/activity/fetcher.rb
index b95ae2bc3..2caef48b8 100644
--- a/lib/redmine/activity/fetcher.rb
+++ b/lib/redmine/activity/fetcher.rb
@@ -82,6 +82,8 @@ module Redmine
def events(from = nil, to = nil, options={})
e = []
@options[:limit] = options[:limit]
+ # modify by nwb
+ @options[:is_public] = options[:is_public]
@scope.each do |event_type|
constantized_providers(event_type).each do |provider|
From 7a9b5156c9b787f4e0ceb1f0f2413f9d5f5d4eaa Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 14 Jul 2014 11:46:52 +0800
Subject: [PATCH 20/68] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BD=AF=E4=BB=B6?=
=?UTF-8?q?=E5=88=9B=E5=AE=A2=E5=88=97=E8=A1=A8=E5=BD=93=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E5=A7=93=E5=90=8D=E6=AF=94=E8=BE=83=E9=95=BF=E6=97=B6=EF=BC=8C?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E5=A7=93=E5=90=8D=E4=BC=9A=E8=A2=AB=E4=B8=AA?=
=?UTF-8?q?=E4=BA=BA=E5=BE=97=E5=88=86=E8=A6=86=E7=9B=96=E6=8E=89=E7=9A=84?=
=?UTF-8?q?BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_show.html.erb | 36 +-
db/schema.rb | 1199 ---------------------------
2 files changed, 21 insertions(+), 1214 deletions(-)
delete mode 100644 db/schema.rb
diff --git a/app/views/users/_user_show.html.erb b/app/views/users/_user_show.html.erb
index d6fa541c7..13f08f7ef 100644
--- a/app/views/users/_user_show.html.erb
+++ b/app/views/users/_user_show.html.erb
@@ -33,21 +33,27 @@
<%= image_tag "/images/time_member.png", :class => "img_member_time"%>
- <%= image_tag(url_to_avatar(user), :class => 'avatar') %>
- <%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
-
-
-
-
- <%= render :partial => 'users/user_score', :locals => {:user => user}%>
-
-
-
-
-
- <%= l(:label_x_has_fans,:count=>user.watcher_users.count)%>
- <%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
-
+
+
+
+ <%= image_tag(url_to_avatar(user), :class => 'avatar') %>
+
+
+ <%= link_to_user(user) %>
+
+
+
+ <%= render :partial => 'users/user_score', :locals => {:user => user}%>
+
+
+
+
+
+ <%= l(:label_x_has_fans,:count=>user.watcher_users.count)%>
+ <%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
+
+
+
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
diff --git a/db/schema.rb b/db/schema.rb
deleted file mode 100644
index fa41ed1d5..000000000
--- a/db/schema.rb
+++ /dev/null
@@ -1,1199 +0,0 @@
-# encoding: UTF-8
-# This file is auto-generated from the current state of the database. Instead
-# of editing this file, please use the migrations feature of Active Record to
-# incrementally modify your database, and then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your
-# database schema. If you need to create the application database on another
-# system, you should be using db:schema:load, not running all the migrations
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20140711012924) do
-
- create_table "activities", :force => true do |t|
- t.integer "act_id", :null => false
- t.string "act_type", :null => false
- t.integer "user_id", :null => false
- end
-
- add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type"
- add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
- add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
-
- create_table "applied_projects", :force => true do |t|
- t.integer "project_id", :null => false
- t.integer "user_id", :null => false
- end
-
- create_table "apply_project_masters", :force => true do |t|
- t.integer "user_id"
- t.string "apply_type"
- t.integer "apply_id"
- t.integer "status"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "attachments", :force => true do |t|
- t.integer "container_id"
- t.string "container_type", :limit => 30
- t.string "filename", :default => "", :null => false
- t.string "disk_filename", :default => "", :null => false
- t.integer "filesize", :default => 0, :null => false
- t.string "content_type", :default => ""
- t.string "digest", :limit => 40, :default => "", :null => false
- t.integer "downloads", :default => 0, :null => false
- t.integer "author_id", :default => 0, :null => false
- t.datetime "created_on"
- t.string "description"
- t.string "disk_directory"
- t.integer "attachtype", :default => 1
- t.integer "is_public", :default => 1
- end
-
- add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id"
- add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type"
- add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on"
-
- create_table "attachmentstypes", :force => true do |t|
- t.integer "typeId", :null => false
- t.string "typeName", :limit => 50
- end
-
- create_table "auth_sources", :force => true do |t|
- t.string "type", :limit => 30, :default => "", :null => false
- t.string "name", :limit => 60, :default => "", :null => false
- t.string "host", :limit => 60
- t.integer "port"
- t.string "account"
- t.string "account_password", :default => ""
- t.string "base_dn"
- t.string "attr_login", :limit => 30
- t.string "attr_firstname", :limit => 30
- t.string "attr_lastname", :limit => 30
- t.string "attr_mail", :limit => 30
- t.boolean "onthefly_register", :default => false, :null => false
- t.boolean "tls", :default => false, :null => false
- t.string "filter"
- t.integer "timeout"
- end
-
- add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type"
-
- create_table "biding_projects", :force => true do |t|
- t.integer "project_id"
- t.integer "bid_id"
- t.integer "user_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- end
-
- create_table "bids", :force => true do |t|
- t.string "name"
- t.string "budget", :null => false
- t.integer "author_id"
- t.date "deadline"
- t.string "description"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- t.integer "commit"
- t.integer "reward_type"
- t.integer "homework_type"
- t.integer "parent_id"
- t.string "password"
- t.integer "is_evaluation"
- t.integer "proportion", :default => 60
- end
-
- create_table "boards", :force => true do |t|
- t.integer "project_id", :null => false
- t.string "name", :default => "", :null => false
- t.string "description"
- t.integer "position", :default => 1
- t.integer "topics_count", :default => 0, :null => false
- t.integer "messages_count", :default => 0, :null => false
- t.integer "last_message_id"
- t.integer "parent_id"
- t.integer "course_id"
- end
-
- add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
- add_index "boards", ["project_id"], :name => "boards_project_id"
-
- create_table "bug_to_osps", :force => true do |t|
- t.integer "osp_id"
- t.integer "relative_memo_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "changes", :force => true do |t|
- t.integer "changeset_id", :null => false
- t.string "action", :limit => 1, :default => "", :null => false
- t.text "path", :null => false
- t.text "from_path"
- t.string "from_revision"
- t.string "revision"
- t.string "branch"
- end
-
- add_index "changes", ["changeset_id"], :name => "changesets_changeset_id"
-
- create_table "changeset_parents", :id => false, :force => true do |t|
- t.integer "changeset_id", :null => false
- t.integer "parent_id", :null => false
- end
-
- add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids"
- add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
-
- create_table "changesets", :force => true do |t|
- t.integer "repository_id", :null => false
- t.string "revision", :null => false
- t.string "committer"
- t.datetime "committed_on", :null => false
- t.text "comments"
- t.date "commit_date"
- t.string "scmid"
- t.integer "user_id"
- end
-
- add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
- add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true
- add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid"
- add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id"
- add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id"
-
- create_table "changesets_issues", :id => false, :force => true do |t|
- t.integer "changeset_id", :null => false
- t.integer "issue_id", :null => false
- end
-
- add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true
-
- create_table "code_review_assignments", :force => true do |t|
- t.integer "issue_id"
- t.integer "change_id"
- t.integer "attachment_id"
- t.string "file_path"
- t.string "rev"
- t.string "rev_to"
- t.string "action_type"
- t.integer "changeset_id"
- end
-
- create_table "code_review_project_settings", :force => true do |t|
- t.integer "project_id"
- t.integer "tracker_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "updated_by"
- t.boolean "hide_code_review_tab", :default => false
- t.integer "auto_relation", :default => 1
- t.integer "assignment_tracker_id"
- t.text "auto_assign"
- t.integer "lock_version", :default => 0, :null => false
- t.boolean "tracker_in_review_dialog", :default => false
- end
-
- create_table "code_review_user_settings", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.integer "mail_notification", :default => 0, :null => false
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- create_table "code_reviews", :force => true do |t|
- t.integer "project_id"
- t.integer "change_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "line"
- t.integer "updated_by_id"
- t.integer "lock_version", :default => 0, :null => false
- t.integer "status_changed_from"
- t.integer "status_changed_to"
- t.integer "issue_id"
- t.string "action_type"
- t.string "file_path"
- t.string "rev"
- t.string "rev_to"
- t.integer "attachment_id"
- t.integer "file_count", :default => 0, :null => false
- t.boolean "diff_all"
- end
-
- create_table "comments", :force => true do |t|
- t.string "commented_type", :limit => 30, :default => "", :null => false
- t.integer "commented_id", :default => 0, :null => false
- t.integer "author_id", :default => 0, :null => false
- t.text "comments"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- end
-
- add_index "comments", ["author_id"], :name => "index_comments_on_author_id"
- add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type"
-
- create_table "contesting_projects", :force => true do |t|
- t.integer "project_id"
- t.string "contest_id"
- t.integer "user_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- end
-
- create_table "contesting_softapplications", :force => true do |t|
- t.integer "softapplication_id"
- t.integer "contest_id"
- t.integer "user_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- end
-
- create_table "contestnotifications", :force => true do |t|
- t.integer "contest_id"
- t.string "title"
- t.string "summary"
- t.string "description"
- t.integer "author_id"
- t.integer "notificationcomments_count"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "contests", :force => true do |t|
- t.string "name"
- t.string "budget", :default => ""
- t.integer "author_id"
- t.date "deadline"
- t.string "description"
- t.integer "commit"
- t.string "password"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- end
-
- create_table "course_infos", :force => true do |t|
- t.integer "course_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "course_statuses", :force => true do |t|
- t.integer "changesets_count"
- t.integer "watchers_count"
- t.integer "course_id"
- t.float "grade", :default => 0.0
- t.integer "course_ac_para", :default => 0
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "courses", :force => true do |t|
- t.integer "tea_id"
- t.string "name"
- t.integer "state"
- t.string "code"
- t.integer "time"
- t.string "extra"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "location"
- t.string "term"
- t.string "string"
- t.string "password"
- t.string "setup_time"
- t.string "endup_time"
- t.string "class_period"
- t.integer "school_id"
- t.text "description"
- t.integer "status", :default => 1
- t.integer "attachmenttype", :default => 2
- t.integer "lft"
- t.integer "rgt"
- t.integer "is_public", :limit => 1, :default => 1
- t.integer "inherit_members", :limit => 1, :default => 1
- end
-
- create_table "custom_fields", :force => true do |t|
- t.string "type", :limit => 30, :default => "", :null => false
- t.string "name", :limit => 30, :default => "", :null => false
- t.string "field_format", :limit => 30, :default => "", :null => false
- t.text "possible_values"
- t.string "regexp", :default => ""
- t.integer "min_length", :default => 0, :null => false
- t.integer "max_length", :default => 0, :null => false
- t.boolean "is_required", :default => false, :null => false
- t.boolean "is_for_all", :default => false, :null => false
- t.boolean "is_filter", :default => false, :null => false
- t.integer "position", :default => 1
- t.boolean "searchable", :default => false
- t.text "default_value"
- t.boolean "editable", :default => true
- t.boolean "visible", :default => true, :null => false
- t.boolean "multiple", :default => false
- end
-
- add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type"
-
- create_table "custom_fields_projects", :id => false, :force => true do |t|
- t.integer "custom_field_id", :default => 0, :null => false
- t.integer "project_id", :default => 0, :null => false
- end
-
- add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true
-
- create_table "custom_fields_trackers", :id => false, :force => true do |t|
- t.integer "custom_field_id", :default => 0, :null => false
- t.integer "tracker_id", :default => 0, :null => false
- end
-
- add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true
-
- create_table "custom_values", :force => true do |t|
- t.string "customized_type", :limit => 30, :default => "", :null => false
- t.integer "customized_id", :default => 0, :null => false
- t.integer "custom_field_id", :default => 0, :null => false
- t.text "value"
- end
-
- add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id"
- add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized"
-
- create_table "documents", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.integer "category_id", :default => 0, :null => false
- t.string "title", :limit => 60, :default => "", :null => false
- t.text "description"
- t.datetime "created_on"
- t.integer "user_id", :default => 0
- end
-
- add_index "documents", ["category_id"], :name => "index_documents_on_category_id"
- add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
- add_index "documents", ["project_id"], :name => "documents_project_id"
-
- create_table "enabled_modules", :force => true do |t|
- t.integer "project_id"
- t.string "name", :null => false
- t.integer "course_id"
- end
-
- add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id"
-
- create_table "enumerations", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.integer "position", :default => 1
- t.boolean "is_default", :default => false, :null => false
- t.string "type"
- t.boolean "active", :default => true, :null => false
- t.integer "project_id"
- t.integer "parent_id"
- t.string "position_name", :limit => 30
- end
-
- add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
- add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
-
- create_table "first_pages", :force => true do |t|
- t.string "web_title"
- t.string "title"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "page_type"
- end
-
- create_table "forums", :force => true do |t|
- t.string "name", :null => false
- t.string "description", :default => ""
- t.integer "topic_count", :default => 0
- t.integer "memo_count", :default => 0
- t.integer "last_memo_id", :default => 0
- t.integer "creator_id", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "groups_users", :id => false, :force => true do |t|
- t.integer "group_id", :null => false
- t.integer "user_id", :null => false
- end
-
- add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true
-
- create_table "homework_attaches", :force => true do |t|
- t.integer "bid_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- t.string "name"
- t.string "description"
- t.integer "state"
- t.integer "project_id", :default => 0
- end
-
- create_table "homework_for_courses", :force => true do |t|
- t.integer "course_id"
- t.integer "bid_id"
- end
-
- create_table "homework_users", :force => true do |t|
- t.string "homework_attach_id"
- t.string "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "issue_categories", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.string "name", :limit => 30, :default => "", :null => false
- t.integer "assigned_to_id"
- end
-
- add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id"
- add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id"
-
- create_table "issue_relations", :force => true do |t|
- t.integer "issue_from_id", :null => false
- t.integer "issue_to_id", :null => false
- t.string "relation_type", :default => "", :null => false
- t.integer "delay"
- end
-
- add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true
- add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id"
- add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id"
-
- create_table "issue_statuses", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.boolean "is_closed", :default => false, :null => false
- t.boolean "is_default", :default => false, :null => false
- t.integer "position", :default => 1
- t.integer "default_done_ratio"
- end
-
- add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed"
- add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default"
- add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position"
-
- create_table "issues", :force => true do |t|
- t.integer "tracker_id", :null => false
- t.integer "project_id", :null => false
- t.string "subject", :default => "", :null => false
- t.text "description"
- t.date "due_date"
- t.integer "category_id"
- t.integer "status_id", :null => false
- t.integer "assigned_to_id"
- t.integer "priority_id", :null => false
- t.integer "fixed_version_id"
- t.integer "author_id", :null => false
- t.integer "lock_version", :default => 0, :null => false
- t.datetime "created_on"
- t.datetime "updated_on"
- t.date "start_date"
- t.integer "done_ratio", :default => 0, :null => false
- t.float "estimated_hours"
- t.integer "parent_id"
- t.integer "root_id"
- t.integer "lft"
- t.integer "rgt"
- t.boolean "is_private", :default => false, :null => false
- t.datetime "closed_on"
- end
-
- add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id"
- add_index "issues", ["author_id"], :name => "index_issues_on_author_id"
- add_index "issues", ["category_id"], :name => "index_issues_on_category_id"
- add_index "issues", ["created_on"], :name => "index_issues_on_created_on"
- add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id"
- add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id"
- add_index "issues", ["project_id"], :name => "issues_project_id"
- add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt"
- add_index "issues", ["status_id"], :name => "index_issues_on_status_id"
- add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id"
-
- create_table "join_in_competitions", :force => true do |t|
- t.integer "user_id"
- t.integer "competition_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "join_in_contests", :force => true do |t|
- t.integer "user_id"
- t.integer "bid_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "journal_details", :force => true do |t|
- t.integer "journal_id", :default => 0, :null => false
- t.string "property", :limit => 30, :default => "", :null => false
- t.string "prop_key", :limit => 30, :default => "", :null => false
- t.text "old_value"
- t.text "value"
- end
-
- add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
-
- create_table "journal_replies", :id => false, :force => true do |t|
- t.integer "journal_id"
- t.integer "user_id"
- t.integer "reply_id"
- end
-
- add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id"
- add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id"
- add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id"
-
- create_table "journals", :force => true do |t|
- t.integer "journalized_id", :default => 0, :null => false
- t.string "journalized_type", :limit => 30, :default => "", :null => false
- t.integer "user_id", :default => 0, :null => false
- t.text "notes"
- t.datetime "created_on", :null => false
- t.boolean "private_notes", :default => false, :null => false
- end
-
- add_index "journals", ["created_on"], :name => "index_journals_on_created_on"
- add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id"
- add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id"
- add_index "journals", ["user_id"], :name => "index_journals_on_user_id"
-
- create_table "journals_for_messages", :force => true do |t|
- t.integer "jour_id"
- t.string "jour_type"
- t.integer "user_id"
- t.text "notes"
- t.integer "status"
- t.integer "reply_id"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- t.string "m_parent_id"
- t.boolean "is_readed"
- t.integer "m_reply_count"
- t.integer "m_reply_id"
- t.integer "is_comprehensive_evaluation"
- end
-
- create_table "member_roles", :force => true do |t|
- t.integer "member_id", :null => false
- t.integer "role_id", :null => false
- t.integer "inherited_from"
- end
-
- add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id"
- add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id"
-
- create_table "members", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.integer "project_id", :default => 0
- t.datetime "created_on"
- t.boolean "mail_notification", :default => false, :null => false
- t.integer "course_id", :default => -1
- end
-
- add_index "members", ["project_id"], :name => "index_members_on_project_id"
- add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true
- add_index "members", ["user_id"], :name => "index_members_on_user_id"
-
- create_table "memos", :force => true do |t|
- t.integer "forum_id", :null => false
- t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :null => false
- t.integer "author_id", :null => false
- t.integer "replies_count", :default => 0
- t.integer "last_reply_id"
- t.boolean "lock", :default => false
- t.boolean "sticky", :default => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "viewed_count", :default => 0
- end
-
- create_table "messages", :force => true do |t|
- t.integer "board_id", :null => false
- t.integer "parent_id"
- t.string "subject", :default => "", :null => false
- t.text "content"
- t.integer "author_id"
- t.integer "replies_count", :default => 0, :null => false
- t.integer "last_reply_id"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- t.boolean "locked", :default => false
- t.integer "sticky", :default => 0
- end
-
- add_index "messages", ["author_id"], :name => "index_messages_on_author_id"
- add_index "messages", ["board_id"], :name => "messages_board_id"
- add_index "messages", ["created_on"], :name => "index_messages_on_created_on"
- add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
- add_index "messages", ["parent_id"], :name => "messages_parent_id"
-
- create_table "news", :force => true do |t|
- t.integer "project_id"
- t.string "title", :limit => 60, :default => "", :null => false
- t.string "summary", :default => ""
- t.text "description"
- t.integer "author_id", :default => 0, :null => false
- t.datetime "created_on"
- t.integer "comments_count", :default => 0, :null => false
- t.integer "course_id"
- end
-
- add_index "news", ["author_id"], :name => "index_news_on_author_id"
- add_index "news", ["created_on"], :name => "index_news_on_created_on"
- add_index "news", ["project_id"], :name => "news_project_id"
-
- create_table "no_uses", :force => true do |t|
- t.integer "user_id", :null => false
- t.string "no_use_type"
- t.integer "no_use_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "notificationcomments", :force => true do |t|
- t.string "notificationcommented_type"
- t.integer "notificationcommented_id"
- t.integer "author_id"
- t.text "notificationcomments"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "open_id_authentication_associations", :force => true do |t|
- t.integer "issued"
- t.integer "lifetime"
- t.string "handle"
- t.string "assoc_type"
- t.binary "server_url"
- t.binary "secret"
- end
-
- create_table "open_id_authentication_nonces", :force => true do |t|
- t.integer "timestamp", :null => false
- t.string "server_url"
- t.string "salt", :null => false
- end
-
- create_table "open_source_projects", :force => true do |t|
- t.string "name"
- t.text "description"
- t.integer "commit_count", :default => 0
- t.integer "code_line", :default => 0
- t.integer "users_count", :default => 0
- t.date "last_commit_time"
- t.string "url"
- t.date "date_collected"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "praise_tread_caches", :force => true do |t|
- t.integer "object_id", :null => false
- t.string "object_type"
- t.integer "praise_num"
- t.integer "tread_num"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "praise_treads", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "praise_tread_object_id"
- t.string "praise_tread_object_type"
- t.integer "praise_or_tread"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "project_infos", :force => true do |t|
- t.integer "project_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "project_statuses", :force => true do |t|
- t.integer "changesets_count"
- t.integer "watchers_count"
- t.integer "project_id"
- t.integer "project_type"
- t.float "grade", :default => 0.0
- t.integer "course_ac_para", :default => 0
- end
-
- add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade"
-
- create_table "projecting_softapplictions", :force => true do |t|
- t.integer "user_id"
- t.integer "softapplication_id"
- t.integer "project_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "projects", :force => true do |t|
- t.string "name", :default => "", :null => false
- t.text "description"
- t.string "homepage", :default => ""
- t.boolean "is_public", :default => true, :null => false
- t.integer "parent_id"
- t.datetime "created_on"
- t.datetime "updated_on"
- t.string "identifier"
- t.integer "status", :default => 1, :null => false
- t.integer "lft"
- t.integer "rgt"
- t.boolean "inherit_members", :default => false, :null => false
- t.integer "project_type"
- t.boolean "hidden_repo", :default => false, :null => false
- t.integer "attachmenttype", :default => 1
- t.integer "user_id"
- end
-
- add_index "projects", ["lft"], :name => "index_projects_on_lft"
- add_index "projects", ["rgt"], :name => "index_projects_on_rgt"
-
- create_table "projects_trackers", :id => false, :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.integer "tracker_id", :default => 0, :null => false
- end
-
- add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true
- add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id"
-
- create_table "queries", :force => true do |t|
- t.integer "project_id"
- t.string "name", :default => "", :null => false
- t.text "filters"
- t.integer "user_id", :default => 0, :null => false
- t.boolean "is_public", :default => false, :null => false
- t.text "column_names"
- t.text "sort_criteria"
- t.string "group_by"
- t.string "type"
- end
-
- add_index "queries", ["project_id"], :name => "index_queries_on_project_id"
- add_index "queries", ["user_id"], :name => "index_queries_on_user_id"
-
- create_table "relative_memo_to_open_source_projects", :force => true do |t|
- t.integer "osp_id"
- t.integer "relative_memo_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "relative_memos", :force => true do |t|
- t.integer "osp_id"
- t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :null => false
- t.integer "author_id"
- t.integer "replies_count", :default => 0
- t.integer "last_reply_id"
- t.boolean "lock", :default => false
- t.boolean "sticky", :default => false
- t.boolean "is_quote", :default => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "viewed_count_crawl", :default => 0
- t.integer "viewed_count_local", :default => 0
- t.string "url"
- t.string "username"
- t.string "userhomeurl"
- t.date "date_collected"
- t.string "topic_resource"
- end
-
- create_table "repositories", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.string "url", :default => "", :null => false
- t.string "login", :limit => 60, :default => ""
- t.string "password", :default => ""
- t.string "root_url", :default => ""
- t.string "type"
- t.string "path_encoding", :limit => 64
- t.string "log_encoding", :limit => 64
- t.text "extra_info"
- t.string "identifier"
- t.boolean "is_default", :default => false
- end
-
- add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
-
- create_table "roles", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.integer "position", :default => 1
- t.boolean "assignable", :default => true
- t.integer "builtin", :default => 0, :null => false
- t.text "permissions"
- t.string "issues_visibility", :limit => 30, :default => "default", :null => false
- end
-
- create_table "schools", :force => true do |t|
- t.string "name"
- t.string "province"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "logo_link"
- end
-
- create_table "seems_rateable_cached_ratings", :force => true do |t|
- t.integer "cacheable_id", :limit => 8
- t.string "cacheable_type"
- t.float "avg", :null => false
- t.integer "cnt", :null => false
- t.string "dimension"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "seems_rateable_rates", :force => true do |t|
- t.integer "rater_id", :limit => 8
- t.integer "rateable_id"
- t.string "rateable_type"
- t.float "stars", :null => false
- t.string "dimension"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "settings", :force => true do |t|
- t.string "name", :default => "", :null => false
- t.text "value"
- t.datetime "updated_on"
- end
-
- add_index "settings", ["name"], :name => "index_settings_on_name"
-
- create_table "shares", :force => true do |t|
- t.date "created_on"
- t.string "url"
- t.string "title"
- t.integer "share_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "project_id"
- t.integer "user_id"
- t.string "description"
- end
-
- create_table "softapplications", :force => true do |t|
- t.string "name"
- t.string "description"
- t.integer "app_type_id"
- t.string "app_type_name"
- t.string "android_min_version_available"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "contest_id"
- t.integer "softapplication_id"
- t.integer "is_public"
- t.string "application_developers"
- t.string "deposit_project_url"
- t.string "deposit_project"
- t.integer "project_id"
- end
-
- create_table "students_for_courses", :force => true do |t|
- t.integer "student_id"
- t.integer "course_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "taggings", :force => true do |t|
- t.integer "tag_id"
- t.integer "taggable_id"
- t.string "taggable_type"
- t.integer "tagger_id"
- t.string "tagger_type"
- t.string "context", :limit => 128
- t.datetime "created_at"
- end
-
- add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
- add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
- add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type"
-
- create_table "tags", :force => true do |t|
- t.string "name"
- end
-
- create_table "teachers", :force => true do |t|
- t.string "tea_name"
- t.string "location"
- t.integer "couurse_time"
- t.integer "course_code"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "extra"
- end
-
- create_table "time_entries", :force => true do |t|
- t.integer "project_id", :null => false
- t.integer "user_id", :null => false
- t.integer "issue_id"
- t.float "hours", :null => false
- t.string "comments"
- t.integer "activity_id", :null => false
- t.date "spent_on", :null => false
- t.integer "tyear", :null => false
- t.integer "tmonth", :null => false
- t.integer "tweek", :null => false
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- end
-
- add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id"
- add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on"
- add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id"
- add_index "time_entries", ["project_id"], :name => "time_entries_project_id"
- add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id"
-
- create_table "tokens", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.string "action", :limit => 30, :default => "", :null => false
- t.string "value", :limit => 40, :default => "", :null => false
- t.datetime "created_on", :null => false
- end
-
- add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id"
- add_index "tokens", ["value"], :name => "tokens_value", :unique => true
-
- create_table "trackers", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.boolean "is_in_chlog", :default => false, :null => false
- t.integer "position", :default => 1
- t.boolean "is_in_roadmap", :default => true, :null => false
- t.integer "fields_bits", :default => 0
- end
-
- create_table "user_extensions", :force => true do |t|
- t.integer "user_id", :null => false
- t.date "birthday"
- t.string "brief_introduction"
- t.integer "gender"
- t.string "location"
- t.string "occupation"
- t.integer "work_experience"
- t.integer "zip_code"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "technical_title"
- t.integer "identity"
- t.string "student_id"
- t.string "teacher_realname"
- t.string "student_realname"
- t.string "location_city"
- t.integer "school_id"
- end
-
- create_table "user_grades", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "project_id", :null => false
- t.float "grade", :default => 0.0
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade"
- add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id"
- add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id"
-
- create_table "user_levels", :force => true do |t|
- t.integer "user_id"
- t.integer "level"
- end
-
- create_table "user_preferences", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.text "others"
- t.boolean "hide_mail", :default => false
- t.string "time_zone"
- end
-
- add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id"
-
- create_table "user_score_details", :force => true do |t|
- t.integer "current_user_id"
- t.integer "target_user_id"
- t.string "score_type"
- t.string "score_action"
- t.integer "user_id"
- t.integer "old_score"
- t.integer "new_score"
- t.integer "current_user_level"
- t.integer "target_user_level"
- t.integer "score_changeable_obj_id"
- t.string "score_changeable_obj_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "user_scores", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "collaboration"
- t.integer "influence"
- t.integer "skill"
- t.integer "active"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "user_statuses", :force => true do |t|
- t.integer "changesets_count"
- t.integer "watchers_count"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.float "grade", :default => 0.0
- end
-
- add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count"
- add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade"
- add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count"
-
- create_table "users", :force => true do |t|
- t.string "login", :default => "", :null => false
- t.string "hashed_password", :limit => 40, :default => "", :null => false
- t.string "firstname", :limit => 30, :default => "", :null => false
- t.string "lastname", :default => "", :null => false
- t.string "mail", :limit => 60, :default => "", :null => false
- t.boolean "admin", :default => false, :null => false
- t.integer "status", :default => 1, :null => false
- t.datetime "last_login_on"
- t.string "language", :limit => 5, :default => ""
- t.integer "auth_source_id"
- t.datetime "created_on"
- t.datetime "updated_on"
- t.string "type"
- t.string "identity_url"
- t.string "mail_notification", :default => "", :null => false
- t.string "salt", :limit => 64
- end
-
- add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
- add_index "users", ["id", "type"], :name => "index_users_on_id_and_type"
- add_index "users", ["type"], :name => "index_users_on_type"
-
- create_table "versions", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.string "name", :default => "", :null => false
- t.string "description", :default => ""
- t.date "effective_date"
- t.datetime "created_on"
- t.datetime "updated_on"
- t.string "wiki_page_title"
- t.string "status", :default => "open"
- t.string "sharing", :default => "none", :null => false
- end
-
- add_index "versions", ["project_id"], :name => "versions_project_id"
- add_index "versions", ["sharing"], :name => "index_versions_on_sharing"
-
- create_table "watchers", :force => true do |t|
- t.string "watchable_type", :default => "", :null => false
- t.integer "watchable_id", :default => 0, :null => false
- t.integer "user_id"
- end
-
- add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type"
- add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id"
- add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type"
-
- create_table "wiki_content_versions", :force => true do |t|
- t.integer "wiki_content_id", :null => false
- t.integer "page_id", :null => false
- t.integer "author_id"
- t.binary "data", :limit => 2147483647
- t.string "compression", :limit => 6, :default => ""
- t.string "comments", :default => ""
- t.datetime "updated_on", :null => false
- t.integer "version", :null => false
- end
-
- add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on"
- add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid"
-
- create_table "wiki_contents", :force => true do |t|
- t.integer "page_id", :null => false
- t.integer "author_id"
- t.text "text", :limit => 2147483647
- t.string "comments", :default => ""
- t.datetime "updated_on", :null => false
- t.integer "version", :null => false
- end
-
- add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id"
- add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id"
-
- create_table "wiki_pages", :force => true do |t|
- t.integer "wiki_id", :null => false
- t.string "title", :null => false
- t.datetime "created_on", :null => false
- t.boolean "protected", :default => false, :null => false
- t.integer "parent_id"
- end
-
- add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id"
- add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title"
- add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id"
-
- create_table "wiki_redirects", :force => true do |t|
- t.integer "wiki_id", :null => false
- t.string "title"
- t.string "redirects_to"
- t.datetime "created_on", :null => false
- end
-
- add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title"
- add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id"
-
- create_table "wikis", :force => true do |t|
- t.integer "project_id", :null => false
- t.string "start_page", :null => false
- t.integer "status", :default => 1, :null => false
- end
-
- add_index "wikis", ["project_id"], :name => "wikis_project_id"
-
- create_table "workflows", :force => true do |t|
- t.integer "tracker_id", :default => 0, :null => false
- t.integer "old_status_id", :default => 0, :null => false
- t.integer "new_status_id", :default => 0, :null => false
- t.integer "role_id", :default => 0, :null => false
- t.boolean "assignee", :default => false, :null => false
- t.boolean "author", :default => false, :null => false
- t.string "type", :limit => 30
- t.string "field_name", :limit => 30
- t.string "rule", :limit => 30
- end
-
- add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id"
- add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id"
- add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status"
- add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id"
-
-end
From 31245f6fb2c7af4b1d551f8937b9f28e7effefac Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 14 Jul 2014 13:55:22 +0800
Subject: [PATCH 21/68] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BD=AF=E4=BB=B6?=
=?UTF-8?q?=E5=88=9B=E5=AE=A2=E5=88=97=E8=A1=A8=E4=B8=AD=E6=9F=90=E4=BA=9B?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9A=84=E7=94=A8=E6=88=B7=E5=90=8D=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E4=B8=8D=E4=B8=BA=E8=B6=85=E9=93=BE=E6=8E=A5(?=
=?UTF-8?q?=E6=9C=AA=E6=BF=80=E6=B4=BB=E8=B4=A6=E6=88=B7)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 4f6cb3e95..bf125972b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -80,11 +80,12 @@ module ApplicationHelper
name = h(user.name(options[:format]))
end
- if user.active? || (User.current.admin? && user.logged?)
- link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
- else
- name
- end
+ #if user.active? || (User.current.admin? && user.logged?)
+ # link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
+ #else
+ # name
+ #end
+ link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
else
h(user.to_s)
end
From ef95835bc6ba1dedba221fb3042ef20ea35f208c Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 14 Jul 2014 14:49:05 +0800
Subject: [PATCH 22/68] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E5=89=8D?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E4=B8=BA=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E5=91=98=E6=97=B6=EF=BC=8C=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=9C=A8=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E7=9A=84=E5=8F=82=E4=B8=8E=E9=A1=B9=E7=9B=AE=E6=A0=8F=E5=86=85?=
=?UTF-8?q?=E6=97=A0=E8=AF=A5=E9=A1=B9=E7=9B=AE=E7=9A=84=E8=AE=B0=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 1d3f0ec42..540f0a312 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -490,11 +490,11 @@ class ProjectsController < ApplicationController
end
end
- def create
-
+ def create
+
@course_tag = params[:project][:project_type]
if(@course_tag=="1")
- if User.current.user_extensions.identity#.include?(UserExtensions::TEACHER,UserExtensions::DEVELOPER)
+ if User.current.user_extensions.identity#.include?(UserExtensions::TEACHER,UserExtensions::DEVELOPER)
@course = Course.new
@course.extra='course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s
@course.safe_attributes = params[:project][:course]
@@ -517,7 +517,7 @@ class ProjectsController < ApplicationController
if @course_tag == '1'
@project.identifier = @course.extra
end
- if @course_tag == '1'
+ if @course_tag == '1'
if User.current.user_extensions.identity == 0
if@course.save
if validate_parent_id && @project.save
@@ -528,7 +528,7 @@ class ProjectsController < ApplicationController
m = Member.new(:user => User.current, :roles => [r])
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
user_grades = UserGrade.create(:user_id => User.current.id, :project_id => @project.id)
- if params[:project][:is_public] == '1'
+ if params[:project][:is_public] == '1'
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :grade => 0, :project_type => @course_tag)
end
@project.members << m
@@ -541,7 +541,7 @@ class ProjectsController < ApplicationController
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
redirect_to new_project_path(attrs, :course => '0')
#Added by young
-
+
elsif params[:course_continue]
redirect_to new_project_path(:course => '1')
#Ended by young
@@ -574,10 +574,11 @@ class ProjectsController < ApplicationController
end
end
else
+ #@project.memberships.create
if validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
# Add current user as a project member if he is not admin
- unless User.current.admin?
+ #unless User.current.admin?
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r])
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
@@ -587,7 +588,7 @@ class ProjectsController < ApplicationController
end
@project.members << m
@project.project_infos << project
- end
+ #end
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_create)
@@ -595,7 +596,7 @@ class ProjectsController < ApplicationController
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
redirect_to new_project_path(attrs, :course => '0')
#Added by young
-
+
elsif params[:course_continue]
redirect_to new_project_path(:course => '1')
#Ended by young
From 2a1a0513624a35a53263d22b63b198f7ccc00003 Mon Sep 17 00:00:00 2001
From: nwb
Date: Mon, 14 Jul 2014 15:15:28 +0800
Subject: [PATCH 23/68] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E5=AF=86=E7=BA=A7BUG=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 113 ++++++++++--------
.../_course_show_all_attachment.html.erb | 2 +-
.../_course_sort_by_attachtypel.html.erb | 2 +-
db/schema.rb | 3 +-
4 files changed, 69 insertions(+), 51 deletions(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index b86630d98..a89f224b6 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -92,57 +92,74 @@ class RepositoriesController < ApplicationController
end
def create
- ##xianbo
- @root_path=RepositoriesHelper::ROOT_PATH
- @repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git"
- @project_path=@root_path+"htdocs/"+@repository_name
- @repository_tag=params[:repository][:upassword]
- @repo_name=User.current.login.to_s+"_"+params[:repository][:identifier]
- logger.info "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+": "+@repository_tag
- logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name
- attrs = pickup_extra_info
- if((@repository_tag!="")&¶ms[:repository_scm]=="Git")
+ if params[:repository_scm].to_s == 'Gitlab'
+ # add by nwb
+ # 增加对gitlab版本库的支持
+ attrs = pickup_extra_info
+ @repository = Repository.factory(params[:repository_scm])
+ @repository.safe_attributes = params[:repository]
+ if attrs[:attrs_extra].keys.any?
+ @repository.merge_extra_info(attrs[:attrs_extra])
+ end
+ @repository.project = @project
+ if request.post? && @repository.save
+ redirect_to settings_project_path(@project, :tab => 'repositories')
+ else
+ render :action => 'new'
+ end
+ else # 原逻辑
+ ##xianbo
+ @root_path=RepositoriesHelper::ROOT_PATH
+ @repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git"
+ @project_path=@root_path+"htdocs/"+@repository_name
+ @repository_tag=params[:repository][:upassword]
+ @repo_name=User.current.login.to_s+"_"+params[:repository][:identifier]
+ logger.info "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+": "+@repository_tag
+ logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name
+ attrs = pickup_extra_info
+ if((@repository_tag!="")&¶ms[:repository_scm]=="Git")
params[:repository][:url]=@project_path
- end
- ###xianbo
- @repository = Repository.factory(params[:repository_scm])
- @repository.safe_attributes = params[:repository]
- if attrs[:attrs_extra].keys.any?
- @repository.merge_extra_info(attrs[:attrs_extra])
- end
- #by xianbo
-
- @repository.project = @project
- if request.post? && @repository.save
- if(params[:repository_scm]=="Git")
- system "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+" "+@repository_tag
- system "echo -e '"+@repo_name+"-write:"+
- " "+@repo_name+"' >> "+@root_path+"group.passwd"
- system "mkdir "+@root_path+"htdocs/"+User.current.login.to_s
- system "git init --bare "+@project_path
- system "mv "+@project_path+"/hooks/post-update{.sample,}"
- system "chmod a+x "+@project_path+"/hooks/post-update"
- system "echo -e 'Allow from all \n Order Deny,Allow \n "+
- " \n"+
- "Require group "+@repo_name+"-write \n "+
- " \n ' >> "+
- @root_path+"htdocs/"+ @repository_name+"/.htaccess"
- system "cd "+@project_path+" ;git update-server-info"
- # if(create_repo_file&&create_passwd&&create_group&&init_repository&&add_privilege&&init_server_info)
- # else
- # logger.info "An error occured when authenticating "+"create passwd"+@creat_passwd+"create_group"+
- # crate_group+"create repository file "+create_repo_file+"init repository"+init_repostory+
- # "aad privilege to rpository"+add_privilege+"init server infos"+init_server_info
- # end
+ end
+ ###xianbo
+ @repository = Repository.factory(params[:repository_scm])
+ @repository.safe_attributes = params[:repository]
+ if attrs[:attrs_extra].keys.any?
+ @repository.merge_extra_info(attrs[:attrs_extra])
+ end
+ #by xianbo
+
+ @repository.project = @project
+ if request.post? && @repository.save
+ if(params[:repository_scm]=="Git")
+ system "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+" "+@repository_tag
+ system "echo -e '"+@repo_name+"-write:"+
+ " "+@repo_name+"' >> "+@root_path+"group.passwd"
+ system "mkdir "+@root_path+"htdocs/"+User.current.login.to_s
+ system "git init --bare "+@project_path
+ system "mv "+@project_path+"/hooks/post-update{.sample,}"
+ system "chmod a+x "+@project_path+"/hooks/post-update"
+ system "echo -e 'Allow from all \n Order Deny,Allow \n "+
+ " \n"+
+ "Require group "+@repo_name+"-write \n "+
+ " \n ' >> "+
+ @root_path+"htdocs/"+ @repository_name+"/.htaccess"
+ system "cd "+@project_path+" ;git update-server-info"
+ # if(create_repo_file&&create_passwd&&create_group&&init_repository&&add_privilege&&init_server_info)
+ # else
+ # logger.info "An error occured when authenticating "+"create passwd"+@creat_passwd+"create_group"+
+ # crate_group+"create repository file "+create_repo_file+"init repository"+init_repostory+
+ # "aad privilege to rpository"+add_privilege+"init server infos"+init_server_info
+ # end
@repository.update_attributes(:login => User.current.login.to_s)
- end
- redirect_to settings_project_path(@project, :tab => 'repositories')
- else if(@repository_tag)
- render :action => 'newrepo', :layout =>'base_projects'
- else
- render :action => 'new', :layout =>'base_projects'
+ end
+ redirect_to settings_project_path(@project, :tab => 'repositories')
+ else if(@repository_tag)
+ render :action => 'newrepo', :layout =>'base_projects'
+ else
+ render :action => 'new', :layout =>'base_projects'
+ end
+ end
end
- end
end
def edit
diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb
index a6da426c6..f94ddc20b 100644
--- a/app/views/files/_course_show_all_attachment.html.erb
+++ b/app/views/files/_course_show_all_attachment.html.erb
@@ -35,7 +35,7 @@
<% end -%>
<% container.attachments.each do |file| %>
- <%if file.is_public == 0 && !User.current.member_of?(@project)%>
+ <%if file.is_public == 0 && !User.current.member_of_course?(@course)%>
<%next%>
<%end%>
">
diff --git a/app/views/files/_course_sort_by_attachtypel.html.erb b/app/views/files/_course_sort_by_attachtypel.html.erb
index cda832493..f0f6c8270 100644
--- a/app/views/files/_course_sort_by_attachtypel.html.erb
+++ b/app/views/files/_course_sort_by_attachtypel.html.erb
@@ -28,7 +28,7 @@
<% @containers.each do |container| %>
<% next if container.attachments.empty? -%>
<% container.attachments.each do |file| %>
- <% if file.is_public == 0 && !User.current.member_of?(@project) %>
+ <% if file.is_public == 0 && !User.current.member_of_course?(@course) %>
<% next %>
<% end %>
<% if isTypeOk(file, selAttachType, selContentType) %>
diff --git a/db/schema.rb b/db/schema.rb
index fa41ed1d5..a304bf94f 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20140711012924) do
+ActiveRecord::Schema.define(:version => 20140714021812) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -379,6 +379,7 @@ ActiveRecord::Schema.define(:version => 20140711012924) do
t.text "description"
t.datetime "created_on"
t.integer "user_id", :default => 0
+ t.integer "is_public", :default => 1
end
add_index "documents", ["category_id"], :name => "index_documents_on_category_id"
From 90e28518f2459e2c09ca89dd1495419a89478348 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 14 Jul 2014 15:45:38 +0800
Subject: [PATCH 24/68] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=A6=E6=A0=A1?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=97=B6=EF=BC=8C=E5=A6=82?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E4=B8=BA=E7=A9=BA=EF=BC=8C?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/school/index.html.erb | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/app/views/school/index.html.erb b/app/views/school/index.html.erb
index 8a5aa5f49..47ac3f968 100644
--- a/app/views/school/index.html.erb
+++ b/app/views/school/index.html.erb
@@ -50,8 +50,14 @@
+
- <%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
+ <%= form_tag( users_search_path, :method => :get, :id => 'search_user_form') do %>
<%= l(:label_software_user ) %>
@@ -9,8 +21,9 @@
- <%= text_field_tag 'name', params[:name], :size => 30 %>
- <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
+ <%= text_field_tag 'name', params[:name], :size => 30 %>
+
+ <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
diff --git a/app/views/users/search.html.erb b/app/views/users/search.html.erb
index 307803b1d..98becc197 100644
--- a/app/views/users/search.html.erb
+++ b/app/views/users/search.html.erb
@@ -1,7 +1,17 @@
-
+
- <%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
+ <%= form_tag( users_search_path, :method => :get, :id => 'search_user_form') do %>
<%= l(:label_software_user ) %>
@@ -10,8 +20,9 @@
- <%= text_field_tag 'name', params[:name], :size => 30 %>
- <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
+ <%= text_field_tag 'name', params[:name], :size => 30 %>
+
+ <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
From e6b80de3b5954d3bbf0e90ecfa25d4b6f3d0a372 Mon Sep 17 00:00:00 2001
From: nwb
Date: Mon, 14 Jul 2014 16:51:18 +0800
Subject: [PATCH 28/68] =?UTF-8?q?rmagick=E8=B0=83=E6=95=B4=E4=B8=BA?=
=?UTF-8?q?=E4=BB=85test=E9=9C=80=E8=A6=81=E5=AE=89=E8=A3=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Gemfile | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/Gemfile b/Gemfile
index 634af9683..5e67af6e7 100644
--- a/Gemfile
+++ b/Gemfile
@@ -32,6 +32,15 @@ group :test do
gem "mocha", "~> 0.13.3"
gem 'capybara', '~> 2.0.0'
gem 'nokogiri', '< 1.6.0'
+
+ platforms :mri, :mingw do
+ group :rmagick do
+ # RMagick 2 supports ruby 1.9
+ # RMagick 1 would be fine for ruby 1.8 but Bundler does not support
+ # different requirements for the same gem on different platforms
+ gem "rmagick", ">= 2.0.0"
+ end
+ end
end
@@ -53,15 +62,6 @@ group :ldap do
end
-platforms :mri, :mingw do
- group :rmagick do
- # RMagick 2 supports ruby 1.9
- # RMagick 1 would be fine for ruby 1.8 but Bundler does not support
- # different requirements for the same gem on different platforms
- gem "rmagick", ">= 2.0.0"
- end
-end
-
# Optional gem for OpenID authentication
group :openid do
gem "ruby-openid", "~> 2.1.4", :require => "openid"
From 61ba2c47ee66d9bd82c89c9a4549307670f111e2 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 15 Jul 2014 09:43:13 +0800
Subject: [PATCH 29/68] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=8E=86=E5=8F=B2?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=AD=E4=BD=9C=E4=B8=9A=E4=B8=BA=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E6=97=B6=E4=BD=9C=E4=B8=9A=E6=98=BE=E7=A4=BA=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E6=9C=AA=E6=94=B9=E5=8F=98=E7=9A=84=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=202.=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE=E8=BF=87=E9=95=BF=EF=BC=8C?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9C=81=E7=95=A5=E5=8F=B7=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E5=92=8C=E9=BC=A0=E6=A0=87=E7=A7=BB=E5=8A=A8=E5=88=B0=E7=9B=B8?=
=?UTF-8?q?=E5=BA=94=E4=BD=8D=E7=BD=AE=E7=9A=84=E6=B0=94=E6=B3=A1=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/bids_controller.rb | 2 +-
app/views/bids/_homework_list.html.erb | 4 +++-
app/views/bids/show_courseEx.html.erb | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb
index b9f9245c8..ef0be71ac 100644
--- a/app/controllers/bids_controller.rb
+++ b/app/controllers/bids_controller.rb
@@ -482,7 +482,7 @@ class BidsController < ApplicationController
#ended
end
- if @bid.homework_type == 1
+ if @bid.homework_type
@homework = HomeworkAttach.new
#@homework_list = @bid.homeworks
#增加作业按评分排序,
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index 9f6b45dbd..a8f1f4356 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -86,10 +86,12 @@
-
+
开发项目 :
<% if homework.project != nil %>
+
<%= link_to homework.project.name,project_path(homework.project.id)%>
+
<% else %>
暂无
<% end %>
diff --git a/app/views/bids/show_courseEx.html.erb b/app/views/bids/show_courseEx.html.erb
index 039de6b7a..992abfd96 100644
--- a/app/views/bids/show_courseEx.html.erb
+++ b/app/views/bids/show_courseEx.html.erb
@@ -1,4 +1,4 @@
-<% if @bid.homework_type == Bid::HomeworkFile %>
+<% if @bid.homework_type %>
<%= render :partial => 'homework' %>
From bff1319c5efd13c89e637b2bf02df53eb3ed9a00 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 15 Jul 2014 09:53:03 +0800
Subject: [PATCH 30/68] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=85=BC=E5=AE=B9=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/course.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/models/course.rb b/app/models/course.rb
index 248f80e0b..4f090d7ed 100644
--- a/app/models/course.rb
+++ b/app/models/course.rb
@@ -300,7 +300,7 @@ class Course < ActiveRecord::Base
end
#项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题
- def name
- read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
- end
+ #def name
+ # read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
+ #end
end
From 37d0560b70da5acacb67f7cf9f25491b0eb23a9c Mon Sep 17 00:00:00 2001
From: yanxd
Date: Tue, 15 Jul 2014 10:27:24 +0800
Subject: [PATCH 31/68] test test
---
config/routes.rb | 1 -
test/integration/routing/courses_test.rb | 71 +++++++++++++++++++++++-
2 files changed, 70 insertions(+), 2 deletions(-)
diff --git a/config/routes.rb b/config/routes.rb
index dfb8d503b..b6e2d7ff3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -577,7 +577,6 @@ RedmineApp::Application.routes.draw do
end
end
- match 'projects/course', :to => 'courses#course', :as => 'courses_course'
match 'courses/search', :to => 'courses#search'
# add by nwb
# 课程路由设置
diff --git a/test/integration/routing/courses_test.rb b/test/integration/routing/courses_test.rb
index 5554cb03d..ee9a8bd0d 100644
--- a/test/integration/routing/courses_test.rb
+++ b/test/integration/routing/courses_test.rb
@@ -21,7 +21,76 @@ class RoutingProjectsTest < ActionController::IntegrationTest
def test_courses
assert_routing(
{ :method => 'get', :path => "/courses" },
- { :controller => 'projects', :action => 'index' }
+ { :controller => 'courses', :action => 'index' }
)
end
+ def test_courses_search
+ assert_routing(
+ "/courses/search",
+ {controller: 'courses', action: 'search'}
+ )
+ end
+
+ def test_courses_item
+ assert_routing(
+ 'courses/233',
+ {controller: 'courses', action: 'show', id: '233'}
+ )
+ # id eq str
+ assert_routing(
+ 'courses/timestypo',
+ {controller: 'courses', action: 'show', id: 'timestypo'}
+ )
+ end
+
+ def test_course_setting
+ assert_routing(
+ 'courses/233/settings',
+ {controller: 'courses', action: 'settings', id: '233'}
+ )
+ end
+
+ def test_course_homework
+ assert_routing(
+ 'courses/233/homework',
+ {controller: 'courses', action: 'homework', id: '233'}
+ )
+ assert_routing(
+ 'courses/233/new_homework',
+ {controller: 'courses', action: 'new_homework', id: '233'}
+ )
+ end
+
+ def test_course_file
+ assert_routing(
+ 'courses/233/file',
+ {controller: 'courses', action: 'file', id: '233'}
+ )
+ end
+
+ def test_course_feedback
+ assert_routing(
+ 'courses/233/feedback',
+ {controller: 'courses', action: 'feedback', id: '233'}
+ )
+ end
+
+ def test_course_member
+ assert_routing(
+ 'courses/233/member',
+ {controller: 'courses', action: 'member', id: '233'}
+ )
+ end
+
+ def test_course_finish_restart_course
+ assert_routing(
+ {path: 'courses/233/finishcourse', method: :post},
+ {controller: 'courses', action: 'finishcourse', id: '233'}
+ )
+ assert_routing(
+ {path: 'courses/233/restartcourse', method: :post},
+ {controller: 'courses', action: 'restartcourse', id: '233'}
+ )
+ end
+
end
From b142953a4b10f4209fcab71c0cfacca1439c7a46 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 15 Jul 2014 10:28:49 +0800
Subject: [PATCH 32/68] =?UTF-8?q?1.=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=9F=E8=83=BD=EF=BC=9A=E6=98=AF=E5=90=A6?=
=?UTF-8?q?=E5=90=AF=E5=8A=A8DTS=E6=B5=8B=E8=AF=95=EF=BC=8C=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E4=B8=BA=E4=B8=8D=E5=90=AF=E7=94=A8=E3=80=82=E6=A0=B9?=
=?UTF-8?q?=E6=8D=AE=E7=94=A8=E6=88=B7=E9=80=89=E6=8B=A9=EF=BC=8C=E5=86=B3?=
=?UTF-8?q?=E5=AE=9A=E5=B7=A6=E4=BE=A7DTS=E6=B5=8B=E8=AF=95=E5=B7=A5?=
=?UTF-8?q?=E5=85=B7=E9=80=89=E9=A1=B9=E6=98=AF=E5=90=A6=E5=9C=A8=E8=AF=A5?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=86=85=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 2 ++
app/views/projects/_form.html.erb | 3 +++
app/views/projects/_tools_expand.html.erb | 4 +++-
app/views/projects/new.html.erb | 15 ++++++++++-----
config/locales/zh.yml | 1 +
db/migrate/20140715015540_dst_test.rb | 9 +++++++++
6 files changed, 28 insertions(+), 6 deletions(-)
create mode 100644 db/migrate/20140715015540_dst_test.rb
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 540f0a312..136703c68 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -513,6 +513,7 @@ class ProjectsController < ApplicationController
@trackers = Tracker.sorted.all
@project = Project.new
@project.user_id = User.current.id
+ @project.dts_test = params[:project][:dts_test]
@project.safe_attributes = params[:project]
if @course_tag == '1'
@project.identifier = @course.extra
@@ -845,6 +846,7 @@ class ProjectsController < ApplicationController
def update
@project.safe_attributes = params[:project]
+ @project.dts_test = params[:project][:dts_test]
if validate_parent_id && @project.save
@course = Course.find_by_extra(@project.identifier)
unless @course.nil?
diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb
index 420cc5100..f5781b26a 100644
--- a/app/views/projects/_form.html.erb
+++ b/app/views/projects/_form.html.erb
@@ -15,6 +15,9 @@
<%= f.check_box :is_public, :style => "margin-left:10px;" %>
<%= f.check_box :hidden_repo, :style => "margin-left:10px;" %>
+
+ <%= f.check_box :dts_test, :style => "margin-left:10px;" %>
+
<%= f.text_field :project_type, :value => 0 %>
<%= wikitoolbar_for 'project_description' %>
diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb
index d5aadc419..aec1ad7a2 100644
--- a/app/views/projects/_tools_expand.html.erb
+++ b/app/views/projects/_tools_expand.html.erb
@@ -14,7 +14,9 @@
<%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>
其他工具
- <%= link_to l(:label_module_share) ,share_show_path(@project) %>
+ <% if @project.dts_test == 1 %>
+ <%= link_to l(:label_module_share) ,share_show_path(@project) %>
+ <% end %>
<%= link_to l(:project_module_documents), project_documents_path(@project) %>
diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb
index aa03a1cc1..e1637e94b 100644
--- a/app/views/projects/new.html.erb
+++ b/app/views/projects/new.html.erb
@@ -5,17 +5,22 @@
<%= render :partial => 'course_form', :locals => { :f => f } %>
- <%= submit_tag l(:button_create), :class => "enterprise"%>
-
+
+ <%= submit_tag l(:button_create), :class => "enterprise"%>
+
+
+
<% else %>
<%=l(:label_project_new)%>
<%=raw l(:label_project_new_description)%>
<%= render :partial => 'form', :locals => { :f => f } %>
-
<%= submit_tag l(:button_create), :class => "enterprise"%>
-
+
+ <%= submit_tag l(:button_create), :class => "enterprise"%>
+
+
+
<% end %>
<%= javascript_tag "$('#project_name').focus();" %>
-
<% end %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 276d09336..04b15bb63 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -1901,6 +1901,7 @@ zh:
field_teacher_name: 教 师
field_hidden_repo: 隐藏代码库
+ field_dts_test: DTS测试工具
label_newbie_faq: '新手指引 & 问答'
label_hot_project: '热门项目'
diff --git a/db/migrate/20140715015540_dst_test.rb b/db/migrate/20140715015540_dst_test.rb
new file mode 100644
index 000000000..46d592d58
--- /dev/null
+++ b/db/migrate/20140715015540_dst_test.rb
@@ -0,0 +1,9 @@
+class DstTest < ActiveRecord::Migration
+ def up
+ add_column :projects, :dts_test, :integer, :default => 0
+ end
+
+ def down
+ remove_column :projects, :dts_test
+ end
+end
From 121ffa0342cdab227a90e72664743de22a97344e Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 15 Jul 2014 15:09:52 +0800
Subject: [PATCH 33/68] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=BA=E9=99=B7?=
=?UTF-8?q?=E6=97=B6=E5=A2=9E=E5=8A=A0=E8=B7=9F=E8=B8=AA=E8=80=85=E7=9A=84?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E5=92=8C=E5=A2=9E=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/issues_controller.rb | 25 +++++++++++++++++++++++++
app/views/issues/_edit.html.erb | 15 +++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 2f7d6e600..edff1888b 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -119,6 +119,7 @@ class IssuesController < ApplicationController
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
+ @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq
respond_to do |format|
format.html {
@@ -194,6 +195,30 @@ class IssuesController < ApplicationController
end
if saved
+
+ #修改界面增加跟踪者
+ watcherlist = @issue.watcher_users
+ select_users = []
+ if params[:issue]
+ if params[:issue][:watcher_user_ids]
+ params[:issue][:watcher_user_ids].each do |user_id|
+ select_users << User.find(user_id)
+ end
+ end
+ end
+ select_users.each do |user|
+ if watcherlist.include? user
+ else
+ @issue.add_watcher user
+ end
+ end
+ watcherlist.each do |user|
+ if select_users.include? user
+ else
+ @issue.remove_watcher user
+ end
+ end
+
render_attachment_warning_if_needed(@issue)
reply_id = params[:reference_user_id].to_i
if reply_id > 0
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index 4c379ae54..8037bee01 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -24,6 +24,21 @@
<%= l(:label_attachment_plural) %>
<%= render :partial => 'attachments/form', :locals => {:container => @issue} %>
+
+
+
+ <%= l(:label_issue_watchers) %>
+
+ <%= watchers_checkboxes(@issue, @available_watchers) %>
+
+
+ <%= link_to l(:label_search_for_watchers),
+ {:controller => 'watchers', :action => 'new', :project_id => @issue.project},
+ :remote => true,
+ :method => 'get' %>
+
+
+
<%= f.hidden_field :lock_version %>
From 6a45a0287d46a20f025a8e9255f36d6000357d83 Mon Sep 17 00:00:00 2001
From: z9hang
Date: Tue, 15 Jul 2014 16:13:50 +0800
Subject: [PATCH 34/68] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=AE=E6=94=B9=E8=B5=84=E6=96=99=E7=95=8C?=
=?UTF-8?q?=E9=9D=A2form.quene=20undefine=E7=9A=84js=E9=94=99=E8=AF=AF?=
=?UTF-8?q?=EF=BC=88=E5=AF=BC=E8=87=B4=E5=8A=A0=E8=BD=BD=E4=B8=AD=E4=B8=8D?=
=?UTF-8?q?=E6=B6=88=E5=A4=B1=E7=9A=84=E5=8E=9F=E5=9B=A0=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/avatar_controller.rb | 36 +++++++++-
app/helpers/avatar_helper.rb | 2 +-
app/views/admin/contest_page_made.html.erb | 2 +-
app/views/admin/course_page_made.html.erb | 2 +-
app/views/admin/first_page_made.html.erb | 2 +-
app/views/avatar/_avatar_form.html.erb | 5 +-
app/views/avatar/delete_image.js.erb | 5 ++
app/views/my/account.html.erb | 21 +++---
config/locales/zh.yml | 1 +
config/routes.rb | 1 +
db/migrate/20140714081030_set_web_title.rb | 1 +
db/schema.rb | 76 ++++++++++++++++++----
public/javascripts/application.js | 2 +-
public/javascripts/avatars.js | 1 +
14 files changed, 128 insertions(+), 29 deletions(-)
create mode 100644 app/views/avatar/delete_image.js.erb
diff --git a/app/controllers/avatar_controller.rb b/app/controllers/avatar_controller.rb
index 73c1dbd90..fa7eb6052 100644
--- a/app/controllers/avatar_controller.rb
+++ b/app/controllers/avatar_controller.rb
@@ -2,7 +2,7 @@ class AvatarController < ApplicationController
#before_filter :set_cache_buster
- include AvatarHelper
+ include AvatarHelper
def upload
# Make sure that API users get used to set this content type
@@ -77,6 +77,40 @@ class AvatarController < ApplicationController
}
end
end
+
+ #add by zjc
+ #删除图片
+ def delete_image
+ @source_type = params[:source_type]
+ @source_id = params[:source_id]
+ @source = nil #eval(@source_type).find(@source_id)
+ c = Object.const_get(@source_type)
+ if c.respond_to?(:find)
+ @source = c.find(@source_id)
+ end
+
+ diskfile=disk_filename(@source_type,@source_id)
+ unless diskfile.nil? || diskfile == ""
+ path = File.dirname(diskfile)
+ if File.directory?(path) && File.exist?(diskfile)
+ File.delete(diskfile)
+ end
+ end
+ rescue e do
+ logger.info e.message
+ end
+ respond_to do |format|
+ format.js
+ format.api {
+ if saved
+ render :action => 'upload', :status => :created
+ else
+ render_validation_errors(@avatar)
+ end
+ }
+ end
+
+ end
private
diff --git a/app/helpers/avatar_helper.rb b/app/helpers/avatar_helper.rb
index 2ebdae0c8..3f6802f59 100644
--- a/app/helpers/avatar_helper.rb
+++ b/app/helpers/avatar_helper.rb
@@ -38,7 +38,7 @@ module AvatarHelper
avatar_image(source)
else
File.join(relative_path,avatar_directory(source.class),'0')
- end
+ end
end
def get_avatar?(source)
diff --git a/app/views/admin/contest_page_made.html.erb b/app/views/admin/contest_page_made.html.erb
index b8a86fa4d..a4407cd6b 100644
--- a/app/views/admin/contest_page_made.html.erb
+++ b/app/views/admin/contest_page_made.html.erb
@@ -17,7 +17,7 @@
<%= l(:label_site_image) %>:
-
+
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@contest_page} %>
diff --git a/app/views/admin/course_page_made.html.erb b/app/views/admin/course_page_made.html.erb
index 4554fb8e0..7d73c7c6e 100644
--- a/app/views/admin/course_page_made.html.erb
+++ b/app/views/admin/course_page_made.html.erb
@@ -16,7 +16,7 @@
<%= l(:label_site_image) %>:
-
+
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@course_page} %>
diff --git a/app/views/admin/first_page_made.html.erb b/app/views/admin/first_page_made.html.erb
index a64bbb443..d3b7416e4 100644
--- a/app/views/admin/first_page_made.html.erb
+++ b/app/views/admin/first_page_made.html.erb
@@ -16,7 +16,7 @@
<%= l(:label_site_image) %>:
-
+
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@first_page} %>
diff --git a/app/views/avatar/_avatar_form.html.erb b/app/views/avatar/_avatar_form.html.erb
index a880f32aa..6f9b9c7b1 100644
--- a/app/views/avatar/_avatar_form.html.erb
+++ b/app/views/avatar/_avatar_form.html.erb
@@ -1,3 +1,4 @@
+
"):d.push('
');return d.join("")},htmlEncode:function(b){return(""+b).replace(/&/g,"&").replace(/>/g,">").replace(//g,">")},htmlDecodeAttr:function(b){return b.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">")},getNextNumber:function(){var b=0;return function(){return++b}}(),getNextId:function(){return"cke_"+this.getNextNumber()},override:function(b,a){var d=a(b);d.prototype=b.prototype;return d},setTimeout:function(b,a,d,g,e){e||(e=window);d||(d=e);return e.setTimeout(function(){g?b.apply(d,[].concat(g)):
-b.apply(d)},a||0)},trim:function(){var b=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(a){return a.replace(b,"")}}(),ltrim:function(){var b=/^[ \t\n\r]+/g;return function(a){return a.replace(b,"")}}(),rtrim:function(){var b=/[ \t\n\r]+$/g;return function(a){return a.replace(b,"")}}(),indexOf:function(b,a){if(typeof a=="function")for(var d=0,g=b.length;d
=0?b[d]:null},bind:function(b,a){return function(){return b.apply(a,arguments)}},createClass:function(b){var a=b.$,d=b.base,g=b.privates||b._,e=b.proto,b=b.statics;!a&&(a=function(){d&&this.base.apply(this,arguments)});if(g)var m=a,a=function(){var d=this._||(this._={}),a;for(a in g){var b=g[a];d[a]=typeof b=="function"?CKEDITOR.tools.bind(b,this):b}m.apply(this,arguments)};if(d){a.prototype=this.prototypedCopy(d.prototype);a.prototype.constructor=a;a.base=
-d;a.baseProto=d.prototype;a.prototype.base=function(){this.base=d.prototype.base;d.apply(this,arguments);this.base=arguments.callee}}e&&this.extend(a.prototype,e,true);b&&this.extend(a,b,true);return a},addFunction:function(b,c){return a.push(function(){return b.apply(c||this,arguments)})-1},removeFunction:function(b){a[b]=null},callFunction:function(b){var c=a[b];return c&&c.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var a=/^-?\d+\.?\d*px$/,c;return function(d){c=
-CKEDITOR.tools.trim(d+"")+"px";return a.test(c)?c:d||""}}(),convertToPx:function(){var a;return function(c){if(!a){a=CKEDITOR.dom.element.createFromHtml('
',CKEDITOR.document);CKEDITOR.document.getBody().append(a)}if(!/%$/.test(c)){a.setStyle("width",c);return a.$.clientWidth}return c}}(),repeat:function(a,c){return Array(c+1).join(a)},tryThese:function(){for(var a,c=0,d=arguments.length;c8)&&e)a=e+":"+a;return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0];return a=
-a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),true)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(a){this.$.open("text/html","replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*]*?>)|^/i,'$&\n