Merge remote-tracking branch 'remotes/origin/szzh' into develop
Conflicts: app/views/welcome/index.html.erb
This commit is contained in:
commit
b7c4f87a8f
36
Gemfile
36
Gemfile
|
@ -1,4 +1,4 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://ruby.taobao.org'
|
||||||
|
|
||||||
unless RUBY_PLATFORM =~ /w32/
|
unless RUBY_PLATFORM =~ /w32/
|
||||||
# unix-like only
|
# unix-like only
|
||||||
|
@ -19,19 +19,34 @@ gem 'acts-as-taggable-on', '2.4.1'
|
||||||
group :development do
|
group :development do
|
||||||
gem 'better_errors', path: 'lib/better_errors'
|
gem 'better_errors', path: 'lib/better_errors'
|
||||||
gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler'
|
gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler'
|
||||||
if ENV['PRY']
|
|
||||||
gem 'pry'
|
|
||||||
gem 'pry-nav'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
# shoulda的版本做了改动
|
|
||||||
#gem "shoulda", "~> 3.3.2"
|
#gem "shoulda", "~> 3.3.2"
|
||||||
gem "shoulda", "> 3.3.2"
|
gem "shoulda", "> 3.3.2"
|
||||||
gem "mocha", "~> 0.13.3"
|
gem "mocha", "~> 0.13.3"
|
||||||
gem 'capybara', '~> 2.0.0'
|
gem 'capybara', '~> 2.0.0'
|
||||||
gem 'nokogiri', '< 1.6.0'
|
gem 'nokogiri', '< 1.6.0'
|
||||||
|
gem 'factory_girl'
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
group :development, :test do
|
||||||
|
gem "guard-rails"
|
||||||
|
gem 'spork-testunit'
|
||||||
|
gem 'guard-spork'
|
||||||
|
gem 'guard-test', '~> 1.0.0'
|
||||||
|
gem 'ruby-prof' unless RUBY_PLATFORM =~ /w32/
|
||||||
|
gem 'pry'
|
||||||
|
gem 'pry-nav'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,15 +68,6 @@ group :ldap do
|
||||||
end
|
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
|
# Optional gem for OpenID authentication
|
||||||
group :openid do
|
group :openid do
|
||||||
gem "ruby-openid", "~> 2.1.4", :require => "openid"
|
gem "ruby-openid", "~> 2.1.4", :require => "openid"
|
||||||
|
|
99
Gemfile.lock
99
Gemfile.lock
|
@ -19,7 +19,7 @@ PATH
|
||||||
rails
|
rails
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://ruby.taobao.org/
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (3.2.13)
|
actionmailer (3.2.13)
|
||||||
|
@ -51,7 +51,7 @@ GEM
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
acts-as-taggable-on (2.4.1)
|
acts-as-taggable-on (2.4.1)
|
||||||
rails (>= 3, < 5)
|
rails (>= 3, < 5)
|
||||||
arel (3.0.2)
|
arel (3.0.3)
|
||||||
builder (3.0.0)
|
builder (3.0.0)
|
||||||
capybara (2.0.3)
|
capybara (2.0.3)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
|
@ -60,6 +60,8 @@ GEM
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
selenium-webdriver (~> 2.0)
|
selenium-webdriver (~> 2.0)
|
||||||
xpath (~> 1.0.0)
|
xpath (~> 1.0.0)
|
||||||
|
celluloid (0.15.2)
|
||||||
|
timers (~> 1.1.0)
|
||||||
childprocess (0.5.3)
|
childprocess (0.5.3)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
climate_control (0.0.3)
|
climate_control (0.0.3)
|
||||||
|
@ -70,14 +72,33 @@ GEM
|
||||||
coffee-rails (3.2.2)
|
coffee-rails (3.2.2)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (~> 3.2.0)
|
railties (~> 3.2.0)
|
||||||
coffee-script (2.2.0)
|
coffee-script (2.3.0)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.7.0)
|
coffee-script-source (1.7.1)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
execjs (2.0.2)
|
execjs (2.2.1)
|
||||||
fastercsv (1.5.0)
|
factory_girl (4.4.0)
|
||||||
|
activesupport (>= 3.0.0)
|
||||||
|
fastercsv (1.5.5)
|
||||||
|
ffi (1.9.3)
|
||||||
ffi (1.9.3-x86-mingw32)
|
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-rails (0.5.2)
|
||||||
|
guard (~> 2.0)
|
||||||
|
guard-spork (1.5.1)
|
||||||
|
childprocess (>= 0.2.3)
|
||||||
|
guard (>= 1.1)
|
||||||
|
spork (>= 0.8.4)
|
||||||
|
guard-test (1.0.0)
|
||||||
|
guard (>= 1.8)
|
||||||
|
test-unit (~> 2.2)
|
||||||
hike (1.2.3)
|
hike (1.2.3)
|
||||||
htmlentities (4.3.2)
|
htmlentities (4.3.2)
|
||||||
i18n (0.6.1)
|
i18n (0.6.1)
|
||||||
|
@ -85,36 +106,56 @@ GEM
|
||||||
jquery-rails (2.0.3)
|
jquery-rails (2.0.3)
|
||||||
railties (>= 3.1.0, < 5.0)
|
railties (>= 3.1.0, < 5.0)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
json (1.8.0)
|
json (1.8.1)
|
||||||
kaminari (0.16.1)
|
kaminari (0.16.1)
|
||||||
actionpack (>= 3.0.0)
|
actionpack (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
|
libv8 (3.16.14.3)
|
||||||
|
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)
|
mail (2.5.4)
|
||||||
mime-types (~> 1.16)
|
mime-types (~> 1.16)
|
||||||
treetop (~> 1.4.8)
|
treetop (~> 1.4.8)
|
||||||
metaclass (0.0.4)
|
metaclass (0.0.4)
|
||||||
mime-types (1.23)
|
method_source (0.8.2)
|
||||||
|
mime-types (1.25.1)
|
||||||
mocha (0.13.3)
|
mocha (0.13.3)
|
||||||
metaclass (~> 0.0.1)
|
metaclass (~> 0.0.1)
|
||||||
multi_json (1.7.6)
|
multi_json (1.10.1)
|
||||||
|
mysql2 (0.3.11)
|
||||||
mysql2 (0.3.11-x86-mingw32)
|
mysql2 (0.3.11-x86-mingw32)
|
||||||
net-ldap (0.3.1)
|
net-ldap (0.3.1)
|
||||||
|
nokogiri (1.5.11)
|
||||||
nokogiri (1.5.11-x86-mingw32)
|
nokogiri (1.5.11-x86-mingw32)
|
||||||
paperclip (3.5.4)
|
paperclip (3.5.4)
|
||||||
activemodel (>= 3.0.0)
|
activemodel (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
cocaine (~> 0.5.3)
|
cocaine (~> 0.5.3)
|
||||||
mime-types
|
mime-types
|
||||||
polyglot (0.3.3)
|
polyglot (0.3.5)
|
||||||
|
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 (1.4.5)
|
||||||
rack-cache (1.2)
|
rack-cache (1.2)
|
||||||
rack (>= 0.4)
|
rack (>= 0.4)
|
||||||
rack-openid (1.3.1)
|
rack-openid (1.4.2)
|
||||||
rack (>= 1.1.0)
|
rack (>= 1.1.0)
|
||||||
ruby-openid (>= 2.1.8)
|
ruby-openid (>= 2.1.8)
|
||||||
rack-raw-upload (1.1.1)
|
rack-raw-upload (1.1.1)
|
||||||
multi_json
|
multi_json
|
||||||
rack-ssl (1.3.3)
|
rack-ssl (1.3.4)
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.2)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
|
@ -134,8 +175,12 @@ GEM
|
||||||
rdoc (~> 3.4)
|
rdoc (~> 3.4)
|
||||||
thor (>= 0.14.6, < 2.0)
|
thor (>= 0.14.6, < 2.0)
|
||||||
rake (10.3.2)
|
rake (10.3.2)
|
||||||
|
rb-fsevent (0.9.4)
|
||||||
|
rb-inotify (0.9.5)
|
||||||
|
ffi (>= 0.5.0)
|
||||||
rdoc (3.12.2)
|
rdoc (3.12.2)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
|
ref (1.0.5)
|
||||||
rich (1.4.6)
|
rich (1.4.6)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari
|
kaminari
|
||||||
|
@ -146,8 +191,8 @@ GEM
|
||||||
sass-rails
|
sass-rails
|
||||||
rmagick (2.13.2)
|
rmagick (2.13.2)
|
||||||
ruby-openid (2.1.8)
|
ruby-openid (2.1.8)
|
||||||
rubyzip (1.1.4)
|
rubyzip (1.1.6)
|
||||||
sass (3.2.14)
|
sass (3.3.10)
|
||||||
sass-rails (3.2.6)
|
sass-rails (3.2.6)
|
||||||
railties (~> 3.2.0)
|
railties (~> 3.2.0)
|
||||||
sass (>= 3.1.10)
|
sass (>= 3.1.10)
|
||||||
|
@ -163,25 +208,36 @@ GEM
|
||||||
shoulda-context (1.2.1)
|
shoulda-context (1.2.1)
|
||||||
shoulda-matchers (2.6.1)
|
shoulda-matchers (2.6.1)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
|
slop (3.5.0)
|
||||||
|
spork (0.9.2)
|
||||||
|
spork-testunit (0.0.8)
|
||||||
|
spork (>= 0.6.0)
|
||||||
sprockets (2.2.2)
|
sprockets (2.2.2)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
thor (0.18.1)
|
test-unit (2.5.5)
|
||||||
|
therubyracer (0.12.1)
|
||||||
|
libv8 (~> 3.16.14.0)
|
||||||
|
ref
|
||||||
|
thor (0.19.1)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
treetop (1.4.14)
|
timers (1.1.0)
|
||||||
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
tzinfo (0.3.37)
|
tzinfo (0.3.40)
|
||||||
uglifier (2.4.0)
|
uglifier (2.5.1)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
websocket (1.0.7)
|
websocket (1.0.7)
|
||||||
|
win32console (1.3.2-x86-mingw32)
|
||||||
xpath (1.0.0)
|
xpath (1.0.0)
|
||||||
nokogiri (~> 1.3)
|
nokogiri (~> 1.3)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
|
ruby
|
||||||
x86-mingw32
|
x86-mingw32
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
@ -193,7 +249,11 @@ DEPENDENCIES
|
||||||
capybara (~> 2.0.0)
|
capybara (~> 2.0.0)
|
||||||
coderay (~> 1.0.6)
|
coderay (~> 1.0.6)
|
||||||
coffee-rails (~> 3.2.1)
|
coffee-rails (~> 3.2.1)
|
||||||
|
factory_girl
|
||||||
fastercsv (~> 1.5.0)
|
fastercsv (~> 1.5.0)
|
||||||
|
guard-rails
|
||||||
|
guard-spork
|
||||||
|
guard-test (~> 1.0.0)
|
||||||
htmlentities
|
htmlentities
|
||||||
i18n (~> 0.6.0)
|
i18n (~> 0.6.0)
|
||||||
jquery-rails (~> 2.0.2)
|
jquery-rails (~> 2.0.2)
|
||||||
|
@ -203,6 +263,8 @@ DEPENDENCIES
|
||||||
net-ldap (~> 0.3.1)
|
net-ldap (~> 0.3.1)
|
||||||
nokogiri (< 1.6.0)
|
nokogiri (< 1.6.0)
|
||||||
paperclip (~> 3.5.4)
|
paperclip (~> 3.5.4)
|
||||||
|
pry
|
||||||
|
pry-nav
|
||||||
rack-mini-profiler!
|
rack-mini-profiler!
|
||||||
rack-openid
|
rack-openid
|
||||||
rails (= 3.2.13)
|
rails (= 3.2.13)
|
||||||
|
@ -212,5 +274,6 @@ DEPENDENCIES
|
||||||
sass-rails (~> 3.2.3)
|
sass-rails (~> 3.2.3)
|
||||||
seems_rateable!
|
seems_rateable!
|
||||||
shoulda (> 3.3.2)
|
shoulda (> 3.3.2)
|
||||||
|
spork-testunit
|
||||||
therubyracer
|
therubyracer
|
||||||
uglifier (>= 1.0.3)
|
uglifier (>= 1.0.3)
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
# More info at https://github.com/guard/guard#readme
|
||||||
|
|
||||||
|
# guard 'rails' do
|
||||||
|
# watch('Gemfile.lock')
|
||||||
|
# watch(%r{^(config|lib)/.*})
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
guard 'spork', :test_unit => true, :test_unit_env => {'RAILS_ENV' => 'test'}, :wait => 60 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
|
||||||
|
|
||||||
|
guard :test, :drb => true, :all_after_pass => false, :all_on_start => false do
|
||||||
|
watch(%r{^test/.+_test\.rb$})
|
||||||
|
watch('test/test_helper.rb') { 'test' }
|
||||||
|
|
||||||
|
# Non-rails
|
||||||
|
watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
|
||||||
|
|
||||||
|
# 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" }
|
||||||
|
|
||||||
|
# Rails < 4
|
||||||
|
watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
|
||||||
|
watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
|
||||||
|
watch(%r{^app/views/(.+)/.+\.erb$}) { |m| "test/functional/#{m[1]}_controller_test.rb" }
|
||||||
|
watch(%r{^app/views/.+$}) { 'test/integration' }
|
||||||
|
watch('app/controllers/application_controller.rb') { ['test/functional', 'test/integration'] }
|
||||||
|
end
|
|
@ -234,4 +234,103 @@ class AdminController < ApplicationController
|
||||||
format.api
|
format.api
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#首页定制
|
||||||
|
def first_page_made
|
||||||
|
if request.get?
|
||||||
|
@first_page = FirstPage.where("page_type = 'project'").first
|
||||||
|
elsif request.post?
|
||||||
|
@first_page = FirstPage.where("page_type = 'project'").first
|
||||||
|
@first_page.web_title = params[:web_title]
|
||||||
|
@first_page.description = params[:description]
|
||||||
|
@first_page.title = params[:title]
|
||||||
|
@first_page.sort_type = params[:sort_type]
|
||||||
|
if @first_page.save
|
||||||
|
respond_to do |format|
|
||||||
|
flash[:notice] = l(:notice_successful_update)
|
||||||
|
format.html {
|
||||||
|
redirect_to admin_first_page_made_path
|
||||||
|
}
|
||||||
|
format.api { render_api_ok }
|
||||||
|
#format.json { render json: @first_page, status: :created, location: @first_page }
|
||||||
|
end
|
||||||
|
else
|
||||||
|
respond_to do |format|
|
||||||
|
flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}"
|
||||||
|
format.html {
|
||||||
|
render :action => 'first_page_made'
|
||||||
|
}
|
||||||
|
format.api { render_validation_errors(@first_page) }
|
||||||
|
#format.json { render json: @first_page.errors, status: :unprocessable_entity }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def course_page_made
|
||||||
|
if request.get?
|
||||||
|
@course_page = FirstPage.where("page_type = 'course'").first
|
||||||
|
@first_page = FirstPage.where("page_type = 'project'").first
|
||||||
|
elsif request.post?
|
||||||
|
@first_page = FirstPage.where("page_type = 'project'").first
|
||||||
|
@course_page = FirstPage.where("page_type = 'course'").first
|
||||||
|
@first_page.web_title = params[:web_title]
|
||||||
|
@course_page.web_title = params[:web_title]
|
||||||
|
@course_page.title = params[:course_title]
|
||||||
|
@course_page.description = params[:course_description]
|
||||||
|
if @first_page.save && @course_page.save
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {
|
||||||
|
flash[:notice] = l(:notice_successful_update)
|
||||||
|
redirect_to admin_course_page_made_path
|
||||||
|
}
|
||||||
|
format.api { render_api_ok }
|
||||||
|
end
|
||||||
|
else
|
||||||
|
respond_to do |format|
|
||||||
|
flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@course_page.errors.full_messages[0]}"
|
||||||
|
#flash.now[:error] = "#{l :label_first_page_create_fail}: #{@course_page.errors.full_messages[0]}"
|
||||||
|
format.html {
|
||||||
|
|
||||||
|
render :action => 'course_page_made'
|
||||||
|
}
|
||||||
|
format.api { render_validation_errors(@first_page) }
|
||||||
|
format.api { render_validation_errors(@course_page) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def contest_page_made
|
||||||
|
if request.get?
|
||||||
|
@contest_page = FirstPage.where("page_type = 'contest'").first
|
||||||
|
@first_page = FirstPage.where("page_type = 'project'").first
|
||||||
|
elsif request.post?
|
||||||
|
@first_page = FirstPage.where("page_type = 'project'").first
|
||||||
|
@contest_page = FirstPage.where("page_type = 'contest'").first
|
||||||
|
@first_page.web_title = params[:web_title]
|
||||||
|
@contest_page.web_title = params[:web_title]
|
||||||
|
@contest_page.title = params[:contest_title]
|
||||||
|
@contest_page.description = params[:contest_description]
|
||||||
|
if @first_page.save && @contest_page.save
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {
|
||||||
|
flash[:notice] = l(:notice_successful_update)
|
||||||
|
redirect_to admin_contest_page_made_path
|
||||||
|
}
|
||||||
|
format.api { render_api_ok }
|
||||||
|
end
|
||||||
|
else
|
||||||
|
respond_to do |format|
|
||||||
|
flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@contest_page.errors.full_messages[0]}"
|
||||||
|
format.html {
|
||||||
|
render :action => 'contest_page_made'
|
||||||
|
}
|
||||||
|
format.api { render_validation_errors(@first_page) }
|
||||||
|
format.api { render_validation_errors(@contest_page) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -55,32 +55,35 @@ class AttachmentsController < ApplicationController
|
||||||
candown = false
|
candown = false
|
||||||
if @attachment.container.has_attribute?(:project) && @attachment.container.project
|
if @attachment.container.has_attribute?(:project) && @attachment.container.project
|
||||||
project = @attachment.container.project
|
project = @attachment.container.project
|
||||||
candown= User.current.member_of?(project)
|
candown= User.current.member_of?(project) || (project.is_public==1 && @attachment.is_public == 1)
|
||||||
elsif @attachment.container.is_a?(Project)
|
elsif @attachment.container.is_a?(Project)
|
||||||
project = @attachment.container
|
project = @attachment.container
|
||||||
candown= User.current.member_of?(project)
|
candown= User.current.member_of?(project) || (project.is_public==1 && @attachment.is_public == 1)
|
||||||
elsif @attachment.container.has_attribute?(:course) && @attachment.container.course
|
elsif @attachment.container.has_attribute?(:course) && @attachment.container.course
|
||||||
course = @attachment.container.course
|
course = @attachment.container.course
|
||||||
candown= User.current.member_of_course?(course)
|
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
|
||||||
elsif @attachment.container.is_a?(Course)
|
elsif @attachment.container.is_a?(Course)
|
||||||
course = @attachment.container
|
course = @attachment.container
|
||||||
candown= User.current.member_of_course?(course)
|
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
|
||||||
elsif @attachment.container.class.to_s=="HomeworkAttach" && @attachment.container.bid.reward_type == 3
|
elsif @attachment.container.class.to_s=="HomeworkAttach" && @attachment.container.bid.reward_type == 3
|
||||||
candown = true
|
candown = true
|
||||||
|
else
|
||||||
|
candown = @attachment.is_public == 1
|
||||||
end
|
end
|
||||||
if candown || User.current.admin?
|
if candown || User.current.admin?
|
||||||
@attachment.increment_download
|
@attachment.increment_download
|
||||||
|
|
||||||
|
if stale?(:etag => @attachment.digest)
|
||||||
|
# images are sent inline
|
||||||
|
send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
|
||||||
|
:type => detect_content_type(@attachment),
|
||||||
|
:disposition => (@attachment.image? ? 'inline' : 'attachment')
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
render_403 :message => :notice_not_authorized
|
render_403 :message => :notice_not_authorized
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if stale?(:etag => @attachment.digest)
|
|
||||||
# images are sent inline
|
|
||||||
send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
|
|
||||||
:type => detect_content_type(@attachment),
|
|
||||||
:disposition => (@attachment.image? ? 'inline' : 'attachment')
|
|
||||||
end
|
|
||||||
rescue => e
|
rescue => e
|
||||||
redirect_to "http://" + (Setting.host_name.to_s) +"/file_not_found.html"
|
redirect_to "http://" + (Setting.host_name.to_s) +"/file_not_found.html"
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ class AvatarController < ApplicationController
|
||||||
|
|
||||||
|
|
||||||
#before_filter :set_cache_buster
|
#before_filter :set_cache_buster
|
||||||
include AvatarHelper
|
include AvatarHelper
|
||||||
|
|
||||||
def upload
|
def upload
|
||||||
# Make sure that API users get used to set this content type
|
# Make sure that API users get used to set this content type
|
||||||
|
@ -77,6 +77,40 @@ class AvatarController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
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
|
private
|
||||||
|
|
||||||
|
|
|
@ -449,7 +449,7 @@ class BidsController < ApplicationController
|
||||||
# 显示作业课程
|
# 显示作业课程
|
||||||
# add by nwb
|
# add by nwb
|
||||||
def show_courseEx
|
def show_courseEx
|
||||||
if (User.current.logged? && User.current.member_of_course?(@bid.courses.first))
|
if (User.current.logged? && (User.current.member_of_course?(@bid.courses.first) || User.current.admin?))
|
||||||
# flash[:notice] = ""
|
# flash[:notice] = ""
|
||||||
@membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current))
|
@membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current))
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ class BidsController < ApplicationController
|
||||||
#ended
|
#ended
|
||||||
end
|
end
|
||||||
|
|
||||||
if @bid.homework_type == 1
|
if @bid.homework_type
|
||||||
@homework = HomeworkAttach.new
|
@homework = HomeworkAttach.new
|
||||||
#@homework_list = @bid.homeworks
|
#@homework_list = @bid.homeworks
|
||||||
#增加作业按评分排序,
|
#增加作业按评分排序,
|
||||||
|
|
|
@ -217,7 +217,7 @@ class CoursesController < ApplicationController
|
||||||
@issue_category ||= IssueCategory.new
|
@issue_category ||= IssueCategory.new
|
||||||
@member ||= @course.members.new
|
@member ||= @course.members.new
|
||||||
@trackers = Tracker.sorted.all
|
@trackers = Tracker.sorted.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
if User.current.user_extensions.identity
|
if User.current.user_extensions.identity
|
||||||
|
@ -239,18 +239,18 @@ class CoursesController < ApplicationController
|
||||||
@trackers = Tracker.sorted.all
|
@trackers = Tracker.sorted.all
|
||||||
|
|
||||||
if User.current.user_extensions.identity == 0
|
if User.current.user_extensions.identity == 0
|
||||||
if @course.save
|
if @course.save
|
||||||
#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
|
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])
|
m = Member.new(:user => User.current, :roles => [r])
|
||||||
m.project_id = -1
|
m.project_id = -1
|
||||||
course = CourseInfos.new(:user_id => User.current.id, :course_id => @course.id)
|
course = CourseInfos.new(:user_id => User.current.id, :course_id => @course.id)
|
||||||
#user_grades = UserGrade.create(:user_id => User.current.id, :course_id => @course.id)
|
#user_grades = UserGrade.create(:user_id => User.current.id, :course_id => @course.id)
|
||||||
if params[:course][:is_public] == '1'
|
if params[:course][:is_public] == '1'
|
||||||
course_status = CourseStatus.create(:course_id => @course.id, :watchers_count => 0, :changesets_count => 0, :grade => 0, :course_type => @course_tag)
|
course_status = CourseStatus.create(:course_id => @course.id, :watchers_count => 0, :changesets_count => 0, :grade => 0, :course_type => @course_tag)
|
||||||
end
|
end
|
||||||
@course.members << m
|
@course.members << m
|
||||||
@course.course_infos << course
|
@course.course_infos << course
|
||||||
#end
|
#end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
|
@ -272,7 +272,7 @@ class CoursesController < ApplicationController
|
||||||
format.api { render_validation_errors(@course) }
|
format.api { render_validation_errors(@course) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -630,7 +630,13 @@ class CoursesController < ApplicationController
|
||||||
:with_subprojects => false,
|
:with_subprojects => false,
|
||||||
:author => @author)
|
:author => @author)
|
||||||
@activity.scope_select {|t| has["show_#{t}"]}
|
@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})
|
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||||
@events_count = events.count
|
@events_count = events.count
|
||||||
|
@ -709,4 +715,4 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,6 +23,7 @@ class DocumentsController < ApplicationController
|
||||||
before_filter :find_model_object, :except => [:index, :new, :create]
|
before_filter :find_model_object, :except => [:index, :new, :create]
|
||||||
before_filter :find_project_from_association, :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 , :except => [:index]#Added by young
|
||||||
|
before_filter :authorize_document
|
||||||
|
|
||||||
helper :attachments
|
helper :attachments
|
||||||
|
|
||||||
|
@ -100,4 +101,12 @@ class DocumentsController < ApplicationController
|
||||||
end
|
end
|
||||||
redirect_to document_path(@document)
|
redirect_to document_path(@document)
|
||||||
end
|
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
|
end
|
||||||
|
|
|
@ -50,14 +50,14 @@ class ForumsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||||
@forums_all = Forum.all
|
@forums_all = Forum.where('1=1')
|
||||||
@forums_count = @forums_all.count
|
@forums_count = @forums_all.count
|
||||||
@forums_pages = Paginator.new @forums_count, @limit, params['page']
|
@forums_pages = Paginator.new @forums_count, @limit, params['page']
|
||||||
|
|
||||||
|
|
||||||
@offset ||= @forums_pages.offset
|
@offset ||= @forums_pages.offset
|
||||||
# @forums = @forums_all.offset(@offset).limit(@limit).all
|
@forums = @forums_all.offset(@offset).limit(@limit).all
|
||||||
@forums = Forum.all
|
#@forums = Forum.all
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
format.json { render json: @forums }
|
format.json { render json: @forums }
|
||||||
|
|
|
@ -119,6 +119,7 @@ class IssuesController < ApplicationController
|
||||||
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
|
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
|
||||||
|
|
||||||
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
|
@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|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
|
@ -194,6 +195,30 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
if saved
|
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)
|
render_attachment_warning_if_needed(@issue)
|
||||||
reply_id = params[:reference_user_id].to_i
|
reply_id = params[:reference_user_id].to_i
|
||||||
if reply_id > 0
|
if reply_id > 0
|
||||||
|
|
|
@ -478,11 +478,11 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
||||||
@course_tag = params[:project][:project_type]
|
@course_tag = params[:project][:project_type]
|
||||||
if(@course_tag=="1")
|
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 = Course.new
|
||||||
@course.extra='course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s
|
@course.extra='course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s
|
||||||
@course.safe_attributes = params[:project][:course]
|
@course.safe_attributes = params[:project][:course]
|
||||||
|
@ -501,11 +501,12 @@ class ProjectsController < ApplicationController
|
||||||
@trackers = Tracker.sorted.all
|
@trackers = Tracker.sorted.all
|
||||||
@project = Project.new
|
@project = Project.new
|
||||||
@project.user_id = User.current.id
|
@project.user_id = User.current.id
|
||||||
|
@project.dts_test = params[:project][:dts_test]
|
||||||
@project.safe_attributes = params[:project]
|
@project.safe_attributes = params[:project]
|
||||||
if @course_tag == '1'
|
if @course_tag == '1'
|
||||||
@project.identifier = @course.extra
|
@project.identifier = @course.extra
|
||||||
end
|
end
|
||||||
if @course_tag == '1'
|
if @course_tag == '1'
|
||||||
if User.current.user_extensions.identity == 0
|
if User.current.user_extensions.identity == 0
|
||||||
if@course.save
|
if@course.save
|
||||||
if validate_parent_id && @project.save
|
if validate_parent_id && @project.save
|
||||||
|
@ -516,7 +517,7 @@ class ProjectsController < ApplicationController
|
||||||
m = Member.new(:user => User.current, :roles => [r])
|
m = Member.new(:user => User.current, :roles => [r])
|
||||||
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
|
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)
|
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)
|
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :grade => 0, :project_type => @course_tag)
|
||||||
end
|
end
|
||||||
@project.members << m
|
@project.members << m
|
||||||
|
@ -529,7 +530,7 @@ class ProjectsController < ApplicationController
|
||||||
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
|
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
|
||||||
redirect_to new_project_path(attrs, :course => '0')
|
redirect_to new_project_path(attrs, :course => '0')
|
||||||
#Added by young
|
#Added by young
|
||||||
|
|
||||||
elsif params[:course_continue]
|
elsif params[:course_continue]
|
||||||
redirect_to new_project_path(:course => '1')
|
redirect_to new_project_path(:course => '1')
|
||||||
#Ended by young
|
#Ended by young
|
||||||
|
@ -562,10 +563,11 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
#@project.memberships.create
|
||||||
if validate_parent_id && @project.save
|
if validate_parent_id && @project.save
|
||||||
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
@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
|
# 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
|
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])
|
m = Member.new(:user => User.current, :roles => [r])
|
||||||
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
|
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
|
||||||
|
@ -575,7 +577,7 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
@project.members << m
|
@project.members << m
|
||||||
@project.project_infos << project
|
@project.project_infos << project
|
||||||
end
|
#end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
|
@ -583,7 +585,7 @@ class ProjectsController < ApplicationController
|
||||||
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
|
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
|
||||||
redirect_to new_project_path(attrs, :course => '0')
|
redirect_to new_project_path(attrs, :course => '0')
|
||||||
#Added by young
|
#Added by young
|
||||||
|
|
||||||
elsif params[:course_continue]
|
elsif params[:course_continue]
|
||||||
redirect_to new_project_path(:course => '1')
|
redirect_to new_project_path(:course => '1')
|
||||||
#Ended by young
|
#Ended by young
|
||||||
|
@ -685,8 +687,14 @@ class ProjectsController < ApplicationController
|
||||||
@activity.scope_select {|t| !has["show_#{t}"].nil?}
|
@activity.scope_select {|t| !has["show_#{t}"].nil?}
|
||||||
# logger.debug "=========================================#{@activity.scope}"
|
# logger.debug "=========================================#{@activity.scope}"
|
||||||
# @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
|
# @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})
|
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||||
@events_count = events.count
|
@events_count = events.count
|
||||||
|
@ -826,6 +834,7 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@project.safe_attributes = params[:project]
|
@project.safe_attributes = params[:project]
|
||||||
|
@project.dts_test = params[:project][:dts_test]
|
||||||
if validate_parent_id && @project.save
|
if validate_parent_id && @project.save
|
||||||
@course = Course.find_by_extra(@project.identifier)
|
@course = Course.find_by_extra(@project.identifier)
|
||||||
unless @course.nil?
|
unless @course.nil?
|
||||||
|
|
|
@ -92,57 +92,74 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
##xianbo
|
if params[:repository_scm].to_s == 'Gitlab'
|
||||||
@root_path=RepositoriesHelper::ROOT_PATH
|
# add by nwb
|
||||||
@repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git"
|
# 增加对gitlab版本库的支持
|
||||||
@project_path=@root_path+"htdocs/"+@repository_name
|
attrs = pickup_extra_info
|
||||||
@repository_tag=params[:repository][:upassword]
|
@repository = Repository.factory('Git')
|
||||||
@repo_name=User.current.login.to_s+"_"+params[:repository][:identifier]
|
@repository.safe_attributes = params[:repository]
|
||||||
logger.info "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+": "+@repository_tag
|
if attrs[:attrs_extra].keys.any?
|
||||||
logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name
|
@repository.merge_extra_info(attrs[:attrs_extra])
|
||||||
attrs = pickup_extra_info
|
end
|
||||||
if((@repository_tag!="")&¶ms[:repository_scm]=="Git")
|
@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
|
params[:repository][:url]=@project_path
|
||||||
end
|
end
|
||||||
###xianbo
|
###xianbo
|
||||||
@repository = Repository.factory(params[:repository_scm])
|
@repository = Repository.factory(params[:repository_scm])
|
||||||
@repository.safe_attributes = params[:repository]
|
@repository.safe_attributes = params[:repository]
|
||||||
if attrs[:attrs_extra].keys.any?
|
if attrs[:attrs_extra].keys.any?
|
||||||
@repository.merge_extra_info(attrs[:attrs_extra])
|
@repository.merge_extra_info(attrs[:attrs_extra])
|
||||||
end
|
end
|
||||||
#by xianbo
|
#by xianbo
|
||||||
|
|
||||||
@repository.project = @project
|
@repository.project = @project
|
||||||
if request.post? && @repository.save
|
if request.post? && @repository.save
|
||||||
if(params[:repository_scm]=="Git")
|
if(params[:repository_scm]=="Git")
|
||||||
system "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+" "+@repository_tag
|
system "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+" "+@repository_tag
|
||||||
system "echo -e '"+@repo_name+"-write:"+
|
system "echo -e '"+@repo_name+"-write:"+
|
||||||
" "+@repo_name+"' >> "+@root_path+"group.passwd"
|
" "+@repo_name+"' >> "+@root_path+"group.passwd"
|
||||||
system "mkdir "+@root_path+"htdocs/"+User.current.login.to_s
|
system "mkdir "+@root_path+"htdocs/"+User.current.login.to_s
|
||||||
system "git init --bare "+@project_path
|
system "git init --bare "+@project_path
|
||||||
system "mv "+@project_path+"/hooks/post-update{.sample,}"
|
system "mv "+@project_path+"/hooks/post-update{.sample,}"
|
||||||
system "chmod a+x "+@project_path+"/hooks/post-update"
|
system "chmod a+x "+@project_path+"/hooks/post-update"
|
||||||
system "echo -e 'Allow from all \n Order Deny,Allow \n "+
|
system "echo -e 'Allow from all \n Order Deny,Allow \n "+
|
||||||
"<Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> \n"+
|
"<Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> \n"+
|
||||||
"Require group "+@repo_name+"-write \n "+
|
"Require group "+@repo_name+"-write \n "+
|
||||||
"</Limit> \n ' >> "+
|
"</Limit> \n ' >> "+
|
||||||
@root_path+"htdocs/"+ @repository_name+"/.htaccess"
|
@root_path+"htdocs/"+ @repository_name+"/.htaccess"
|
||||||
system "cd "+@project_path+" ;git update-server-info"
|
system "cd "+@project_path+" ;git update-server-info"
|
||||||
# if(create_repo_file&&create_passwd&&create_group&&init_repository&&add_privilege&&init_server_info)
|
# if(create_repo_file&&create_passwd&&create_group&&init_repository&&add_privilege&&init_server_info)
|
||||||
# else
|
# else
|
||||||
# logger.info "An error occured when authenticating "+"create passwd"+@creat_passwd+"create_group"+
|
# 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+
|
# crate_group+"create repository file "+create_repo_file+"init repository"+init_repostory+
|
||||||
# "aad privilege to rpository"+add_privilege+"init server infos"+init_server_info
|
# "aad privilege to rpository"+add_privilege+"init server infos"+init_server_info
|
||||||
# end
|
# end
|
||||||
@repository.update_attributes(:login => User.current.login.to_s)
|
@repository.update_attributes(:login => User.current.login.to_s)
|
||||||
end
|
end
|
||||||
redirect_to settings_project_path(@project, :tab => 'repositories')
|
redirect_to settings_project_path(@project, :tab => 'repositories')
|
||||||
else if(@repository_tag)
|
else if(@repository_tag)
|
||||||
render :action => 'newrepo', :layout =>'base_projects'
|
render :action => 'newrepo', :layout =>'base_projects'
|
||||||
else
|
else
|
||||||
render :action => 'new', :layout =>'base_projects'
|
render :action => 'new', :layout =>'base_projects'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
|
|
@ -38,7 +38,7 @@ class StoresController < ApplicationController
|
||||||
LIMIT = 12 unless const_defined?(:LIMIT)
|
LIMIT = 12 unless const_defined?(:LIMIT)
|
||||||
def index
|
def index
|
||||||
@projects_attach = project_classification(0).take(LIMIT)
|
@projects_attach = project_classification(0).take(LIMIT)
|
||||||
@courses_attach = Attachment.includes(:course).where("courses.is_public = ?", 1).
|
@courses_attach = Attachment.includes(:course).where("courses.is_public = 1").
|
||||||
where(container_type: 'Course').
|
where(container_type: 'Course').
|
||||||
limit(LIMIT)
|
limit(LIMIT)
|
||||||
# @projects_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 0, 1).
|
# @projects_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 0, 1).
|
||||||
|
|
|
@ -53,6 +53,7 @@ class UsersController < ApplicationController
|
||||||
include CustomFieldsHelper
|
include CustomFieldsHelper
|
||||||
include AvatarHelper
|
include AvatarHelper
|
||||||
include WordsHelper
|
include WordsHelper
|
||||||
|
include GitlabHelper
|
||||||
|
|
||||||
# added by liuping 关注
|
# added by liuping 关注
|
||||||
|
|
||||||
|
@ -329,7 +330,7 @@ class UsersController < ApplicationController
|
||||||
when 'xml', 'json'
|
when 'xml', 'json'
|
||||||
@offset, @limit = api_offset_and_limit({:limit => 15})
|
@offset, @limit = api_offset_and_limit({:limit => 15})
|
||||||
else
|
else
|
||||||
@limit = 15#per_page_option
|
@limit = 15#per_page_option
|
||||||
end
|
end
|
||||||
|
|
||||||
@status = params[:status] || 1
|
@status = params[:status] || 1
|
||||||
|
|
|
@ -16,11 +16,44 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
class WelcomeController < ApplicationController
|
class WelcomeController < ApplicationController
|
||||||
|
include ApplicationHelper
|
||||||
|
include WelcomeHelper
|
||||||
caches_action :robots
|
caches_action :robots
|
||||||
# before_filter :fake, :only => [:index, :course]
|
# before_filter :fake, :only => [:index, :course]
|
||||||
before_filter :entry_select, :only => [:index]
|
before_filter :entry_select, :only => [:index]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@first_page = FirstPage.where("page_type = 'project'").first
|
||||||
|
@hot_projects = find_miracle_project(10, 3)
|
||||||
|
@hot_projects_ids = []
|
||||||
|
@hot_projects.each do |p|
|
||||||
|
@hot_projects_ids << p
|
||||||
|
end
|
||||||
|
@projects_all = Project.active.visible.
|
||||||
|
joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").
|
||||||
|
where("#{Project.table_name}.project_type = ? and #{Project.table_name}.id in (?)", Project::ProjectType_project,@hot_projects_ids)
|
||||||
|
if @first_page.nil? || @first_page.sort_type.nil?
|
||||||
|
@projects = @projects_all.order("grade desc")
|
||||||
|
else
|
||||||
|
case @first_page.sort_type
|
||||||
|
when 0
|
||||||
|
@projects = @projects_all.order("created_on desc")
|
||||||
|
when 1
|
||||||
|
@projects = @projects_all.order("grade desc")
|
||||||
|
when 2
|
||||||
|
@projects = @projects_all.order("watchers_count desc")
|
||||||
|
|
||||||
|
#gcm
|
||||||
|
#when '3'
|
||||||
|
#@projects=desc_sort_course_by_avtivity(@project_activity_count_array,@project_all_array)
|
||||||
|
# @projects=handle_project @projects_all,@project_activity_count
|
||||||
|
# @s_type = 3
|
||||||
|
# @projects = @projects[@project_pages.offset, @project_pages.per_page]
|
||||||
|
|
||||||
|
else
|
||||||
|
@projects = @projects_all.order("grade desc")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,6 +63,7 @@ class WelcomeController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def course
|
def course
|
||||||
|
@course_page = FirstPage.where("page_type = 'course'").first
|
||||||
if params[:school_id]
|
if params[:school_id]
|
||||||
@school_id = params[:school_id]
|
@school_id = params[:school_id]
|
||||||
elsif User.current.logged? && User.current.user_extensions.school
|
elsif User.current.logged? && User.current.user_extensions.school
|
||||||
|
@ -41,13 +75,24 @@ class WelcomeController < ApplicationController
|
||||||
|
|
||||||
|
|
||||||
def logolink()
|
def logolink()
|
||||||
|
@course_page = FirstPage.where("page_type = 'course'").first
|
||||||
|
logo = get_avatar?(@course_page)
|
||||||
id = params[:school_id]
|
id = params[:school_id]
|
||||||
logo_link = ""
|
logo_link = ""
|
||||||
if id.nil? and User.current.user_extensions.school.nil?
|
if id.nil? && User.current.user_extensions.school.nil?
|
||||||
logo_link = '/images/transparent.png'
|
if logo
|
||||||
|
logo_link = url_to_avatar(@course_page)
|
||||||
|
else
|
||||||
|
logo_link = '/images/transparent.png'
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
if id == "0"
|
if id == "0"
|
||||||
logo_link = '/images/transparent.png'
|
if logo
|
||||||
|
logo_link = url_to_avatar(@course_page)
|
||||||
|
else
|
||||||
|
logo_link = '/images/transparent.png'
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if id.nil?
|
if id.nil?
|
||||||
if School.find(User.current.user_extensions.school.id).logo_link.nil?
|
if School.find(User.current.user_extensions.school.id).logo_link.nil?
|
||||||
|
@ -66,7 +111,7 @@ class WelcomeController < ApplicationController
|
||||||
|
|
||||||
|
|
||||||
def contest
|
def contest
|
||||||
|
@contest_page = FirstPage.where("page_type = 'contest'").first
|
||||||
end
|
end
|
||||||
|
|
||||||
def search
|
def search
|
||||||
|
|
|
@ -80,11 +80,12 @@ module ApplicationHelper
|
||||||
name = h(user.name(options[:format]))
|
name = h(user.name(options[:format]))
|
||||||
end
|
end
|
||||||
|
|
||||||
if user.active? || (User.current.admin? && user.logged?)
|
#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
|
# link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
|
||||||
else
|
#else
|
||||||
name
|
# name
|
||||||
end
|
#end
|
||||||
|
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
|
||||||
else
|
else
|
||||||
h(user.to_s)
|
h(user.to_s)
|
||||||
end
|
end
|
||||||
|
@ -256,8 +257,8 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_activity_description(text)
|
def format_activity_description(text)
|
||||||
h(truncate(text.to_s, :length => 120).gsub(%r{[\r\n]*<(pre|code)>.*$}m, '...')
|
h(truncate(text.to_s, :length => 120).gsub(%r{[\r\n]*<(pre|code)>.*$}m, '...')).gsub(/[\r\n]+/, "<br />").html_safe
|
||||||
).gsub(/[\r\n]+/, "<br />").html_safe
|
#h(truncate(text.to_s, :length => 120).gsub(/<\/?.*?>/,"")).html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_version_name(version)
|
def format_version_name(version)
|
||||||
|
@ -625,10 +626,15 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def html_title(*args)
|
def html_title(*args)
|
||||||
|
first_page = FirstPage.where("page_type = 'project'").first
|
||||||
if args.empty?
|
if args.empty?
|
||||||
title = @html_title || []
|
title = @html_title || []
|
||||||
title << @project.name if @project
|
title << @project.name if @project
|
||||||
title << Setting.app_title unless Setting.app_title == title.last
|
if first_page.nil? || first_page.web_title.nil?
|
||||||
|
title << Setting.app_title unless Setting.app_title == title.last
|
||||||
|
else
|
||||||
|
title << first_page.web_title unless first_page.web_title == title.last
|
||||||
|
end
|
||||||
title.select {|t| !t.blank? }.join(' - ')
|
title.select {|t| !t.blank? }.join(' - ')
|
||||||
else
|
else
|
||||||
@html_title ||= []
|
@html_title ||= []
|
||||||
|
|
|
@ -38,7 +38,7 @@ module AvatarHelper
|
||||||
avatar_image(source)
|
avatar_image(source)
|
||||||
else
|
else
|
||||||
File.join(relative_path,avatar_directory(source.class),'0')
|
File.join(relative_path,avatar_directory(source.class),'0')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_avatar?(source)
|
def get_avatar?(source)
|
||||||
|
|
|
@ -104,10 +104,17 @@ module CoursesHelper
|
||||||
garble count
|
garble count
|
||||||
end
|
end
|
||||||
|
|
||||||
alias studentCountOrigin studentCount
|
# 注意:此方法有问题,速度慢且结果不准
|
||||||
|
# alias studentCountOrigin studentCount
|
||||||
|
#def studentCount course
|
||||||
|
# count = studentCountOrigin course
|
||||||
|
#garble count
|
||||||
|
# end
|
||||||
|
|
||||||
|
# 学生人数计算
|
||||||
|
# add by nwb
|
||||||
def studentCount course
|
def studentCount course
|
||||||
count = studentCountOrigin course
|
course.student.count
|
||||||
garble count
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def eventToLanguageCourse event_type, course
|
def eventToLanguageCourse event_type, course
|
||||||
|
|
|
@ -0,0 +1,247 @@
|
||||||
|
# Gitlab5.3 API操作接口
|
||||||
|
# Add by nwb
|
||||||
|
# 暂时没支持SSH
|
||||||
|
# 接口通过HTTP协议与服务器交互,理论上只要能安装gitlab的操作系统本接口都能支持
|
||||||
|
# 本机的测试环境是Ubuntu 12.04
|
||||||
|
|
||||||
|
module GitlabHelper
|
||||||
|
|
||||||
|
# gitlab版本库数据本地保存的根目录
|
||||||
|
ROOT_PATH="/home/git/repositories/"
|
||||||
|
PROJECT_PATH_CUT = 40
|
||||||
|
# gitlab版本库所在服务器
|
||||||
|
# 注意REPO_IP_ADDRESS必须以http://开头,暂时只支持HTTP协议,未支持SSH
|
||||||
|
#REPO_IP_ADDRESS = "http://" + Setting.repository_domain
|
||||||
|
REPO_IP_ADDRESS = "http://192.168.137.100"
|
||||||
|
GITLAB_API = "/api/v3"
|
||||||
|
|
||||||
|
# 用户在项目中的权限级别
|
||||||
|
GUEST = 10
|
||||||
|
REPORTER = 20
|
||||||
|
DEVELOPER = 30
|
||||||
|
MASTER = 40
|
||||||
|
|
||||||
|
# gitlab的登录验证信息
|
||||||
|
# add by nwb
|
||||||
|
def self.gitlab_token=(token)
|
||||||
|
Thread.current[:gitlab_token] = token
|
||||||
|
end
|
||||||
|
|
||||||
|
# gitlab的登录验证信息
|
||||||
|
# add by nwb
|
||||||
|
def self.gitlab_token
|
||||||
|
Thread.current[:gitlab_token] ||= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
# 登录gitlab
|
||||||
|
# add by nwb
|
||||||
|
def login_gitlab(email,password)
|
||||||
|
url = REPO_IP_ADDRESS + GITLAB_API + "/session"
|
||||||
|
uri = URI.parse(url)
|
||||||
|
data = {email:email, password:password}
|
||||||
|
begin
|
||||||
|
res = Net::HTTP.post_form(uri, data)
|
||||||
|
if res.code == '201'
|
||||||
|
temp = ActiveSupport::JSON.decode(res.body)
|
||||||
|
GitlabHelper.gitlab_token= temp['private_token']
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
rescue =>err
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 创建项目
|
||||||
|
# add by nwb
|
||||||
|
def create_project(project_name)
|
||||||
|
url = REPO_IP_ADDRESS + GITLAB_API + "/projects"
|
||||||
|
uri = URI.parse(url)
|
||||||
|
data = {name:project_name, private_token:GitlabHelper.gitlab_token}
|
||||||
|
begin
|
||||||
|
res = Net::HTTP.post_form(uri, data)
|
||||||
|
if res.code == '201'
|
||||||
|
temp = ActiveSupport::JSON.decode(res.body)
|
||||||
|
#新创建项目的版本库地址
|
||||||
|
respo = temp['http_url_to_repo']
|
||||||
|
respo['http://localhost'] = REPO_IP_ADDRESS
|
||||||
|
# 新创建项目的web地址
|
||||||
|
webaddress = temp['web_url']
|
||||||
|
webaddress['http://localhost'] = REPO_IP_ADDRESS
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
rescue =>err
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 为指定用户创建版本库
|
||||||
|
# project_name:版本库名称 user_id:Gitlab版本库中的用户编号
|
||||||
|
# add by nwb
|
||||||
|
def create_project_for_user(project_name,user_id)
|
||||||
|
url = REPO_IP_ADDRESS + GITLAB_API + "/projects/user/" + user_id
|
||||||
|
uri = URI.parse(url)
|
||||||
|
data = {user_id:user_id, name:project_name,private_token:GitlabHelper.gitlab_token}
|
||||||
|
begin
|
||||||
|
res = Net::HTTP.post_form(uri, data)
|
||||||
|
if res.code == '201'
|
||||||
|
temp = ActiveSupport::JSON.decode(res.body)
|
||||||
|
#新创建项目的版本库地址
|
||||||
|
respo = temp['http_url_to_repo']
|
||||||
|
respo['http://localhost'] = REPO_IP_ADDRESS
|
||||||
|
# 新创建项目的web地址
|
||||||
|
webaddress = temp['web_url']
|
||||||
|
webaddress['http://localhost'] = REPO_IP_ADDRESS
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
rescue =>err
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 创建用户
|
||||||
|
# loginname:登录名称(版本库路径包含) name:用户姓名
|
||||||
|
# add by nwb
|
||||||
|
def create_user (loginname,name,password,email)
|
||||||
|
url = REPO_IP_ADDRESS + GITLAB_API + "/users"
|
||||||
|
uri = URI.parse(url)
|
||||||
|
data = {email:email,password:password,username:loginname, name:name, private_token:GitlabHelper.gitlab_token}
|
||||||
|
begin
|
||||||
|
res = Net::HTTP.post_form(uri, data)
|
||||||
|
if res.code == '201'
|
||||||
|
temp = ActiveSupport::JSON.decode(res.body)
|
||||||
|
#新创建的gitlab用户编号(需保存)
|
||||||
|
user_id = temp['id']
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
rescue =>err
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 删除用户
|
||||||
|
# user_id:用户在gitlab中的id
|
||||||
|
# add by nwb
|
||||||
|
def delete_user(user_id)
|
||||||
|
url = REPO_IP_ADDRESS + GITLAB_API + "/users/" + user_id
|
||||||
|
uri = URI.parse(url)
|
||||||
|
data = {id:user_id,private_token:GitlabHelper.gitlab_token}
|
||||||
|
http = Net::HTTP.new uri.host, uri.port
|
||||||
|
begin
|
||||||
|
req = Net::HTTP::Delete.new(uri.request_uri)
|
||||||
|
req.form_data = data
|
||||||
|
res= http.start { |http| http.request req }
|
||||||
|
if res.code == '200'
|
||||||
|
temp = ActiveSupport::JSON.decode(res.body)
|
||||||
|
# 删除成功,对应更新trustie用户的gitlab用户编号
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
rescue =>err
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 给用户添加一个可操作的项目
|
||||||
|
# 若用户已在该项目中,权限级别取新权限与现有权限的最大值
|
||||||
|
# project_id:项目在gitlab中的id user_id:用户在gitlab中的id
|
||||||
|
# access_level为用户在项目中的权限级别,对应如下:
|
||||||
|
#GUEST = 10
|
||||||
|
#REPORTER = 20
|
||||||
|
#DEVELOPER = 30
|
||||||
|
#MASTER = 40
|
||||||
|
# add by nwb
|
||||||
|
def add_user_to_project(project_id,user_id,access_level)
|
||||||
|
url = REPO_IP_ADDRESS + GITLAB_API + "/projects/" + project_id +"/members"
|
||||||
|
uri = URI.parse(url)
|
||||||
|
data = {id:project_id,user_id:user_id,access_level:access_level, private_token:GitlabHelper.gitlab_token}
|
||||||
|
begin
|
||||||
|
res = Net::HTTP.post_form(uri, data)
|
||||||
|
if res.code == '201'
|
||||||
|
temp = ActiveSupport::JSON.decode(res.body)
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
rescue =>err
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 从项目中删除用户
|
||||||
|
# project_id:项目在gitlab中的ids user_id:用户在gitlab中的id
|
||||||
|
# add by nwb
|
||||||
|
def delete_user_from_project(project_id,user_id)
|
||||||
|
url = REPO_IP_ADDRESS + GITLAB_API + "/projects/" + project_id +"/members/" + user_id
|
||||||
|
uri = URI.parse(url)
|
||||||
|
data = {id:project_id,user_id:user_id,private_token:GitlabHelper.gitlab_token}
|
||||||
|
http = Net::HTTP.new uri.host, uri.port
|
||||||
|
begin
|
||||||
|
req = Net::HTTP::Delete.new(uri.request_uri)
|
||||||
|
req.form_data = data
|
||||||
|
res= http.start { |http| http.request req }
|
||||||
|
if res.code == '200'
|
||||||
|
temp = ActiveSupport::JSON.decode(res.body)
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
rescue =>err
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 发送post消息
|
||||||
|
# add by nwb
|
||||||
|
def post(url, params)
|
||||||
|
uri = URI.parse(url)
|
||||||
|
http = Net::HTTP.new(uri.host, uri.port)
|
||||||
|
if uri.scheme == 'https'
|
||||||
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||||
|
http.use_ssl = true
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
request = Net::HTTP::Post.new(uri.request_uri)
|
||||||
|
request['Content-Type'] = 'application/json;charset=utf-8'
|
||||||
|
request['User-Agent'] = 'Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 Firefox/29.0'
|
||||||
|
request['X-ACL-TOKEN'] = 'xxx_token'
|
||||||
|
#request.set_form_data(params)
|
||||||
|
request.body = params.to_json
|
||||||
|
response = http.start { |http| http.request(request) }
|
||||||
|
return JSON.parse response.body
|
||||||
|
rescue =>err
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 发送get消息
|
||||||
|
# add by nwb
|
||||||
|
def get(url, params)
|
||||||
|
uri = URI.parse(url)
|
||||||
|
uri.query = URI.encode_www_form(params)
|
||||||
|
http = Net::HTTP.new uri.host, uri.port
|
||||||
|
if uri.scheme == 'https'
|
||||||
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||||
|
http.use_ssl = true
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
request = Net::HTTP::Get.new uri.request_uri
|
||||||
|
request['Content-Type'] = 'application/json;charset=utf-8'
|
||||||
|
request['User-Agent'] = 'Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 Firefox/29.0'
|
||||||
|
request['X-ACL-TOKEN'] = 'xxx_token'
|
||||||
|
response = http.start { |http| http.request request }
|
||||||
|
return JSON.parse response.body
|
||||||
|
rescue =>err
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -16,6 +16,8 @@ module StoresHelper
|
||||||
news_path(container)
|
news_path(container)
|
||||||
when 'Project'
|
when 'Project'
|
||||||
project_files_path(container)
|
project_files_path(container)
|
||||||
|
when 'Course'
|
||||||
|
course_files_path(container)
|
||||||
when 'Version'
|
when 'Version'
|
||||||
# version_path(container)
|
# version_path(container)
|
||||||
project_files_path(container.project)
|
project_files_path(container.project)
|
||||||
|
|
|
@ -208,7 +208,7 @@ module WelcomeHelper
|
||||||
#c1 = find_new_project(sum).to_a.dup
|
#c1 = find_new_project(sum).to_a.dup
|
||||||
#c2 = find_all_hot_project(sum).to_a.dup
|
#c2 = find_all_hot_project(sum).to_a.dup
|
||||||
#(c2.take(sum-max)+c1.take(max)).take(sum)
|
#(c2.take(sum-max)+c1.take(max)).take(sum)
|
||||||
find_all_hot_project(sum).to_a.dup
|
find_all_hot_project(sum).dup#.to_a.dup
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_new_course limit=15
|
def find_new_course limit=15
|
||||||
|
@ -433,7 +433,7 @@ module WelcomeHelper
|
||||||
# FROM projects AS p LEFT OUTER JOIN (
|
# FROM projects AS p LEFT OUTER JOIN (
|
||||||
# SELECT project_id,grade FROM project_statuses
|
# SELECT project_id,grade FROM project_statuses
|
||||||
# WHERE project_type = #{project_type} ORDER BY #{order_by} LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
# WHERE project_type = #{project_type} ORDER BY #{order_by} LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
||||||
Project.visible.joins(:project_status).where("#{Project.table_name}.project_type = ?", project_type).order(order_by).limit(limit).all
|
Project.visible.joins(:project_status).where("#{Project.table_name}.project_type = ?", project_type).order(order_by).limit(limit)#.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def sort_bid_by_hot_rails reward_type, limit = 10
|
def sort_bid_by_hot_rails reward_type, limit = 10
|
||||||
|
|
|
@ -39,19 +39,22 @@ class Attachment < ActiveRecord::Base
|
||||||
|
|
||||||
#课程资源文件
|
#课程资源文件
|
||||||
acts_as_activity_provider :type => 'course_files',
|
acts_as_activity_provider :type => 'course_files',
|
||||||
|
:is_public => 'attachments.is_public',
|
||||||
:permission => :view_files,
|
:permission => :view_files,
|
||||||
:author_key => :author_id,
|
:author_key => :author_id,
|
||||||
:find_options => {:select => "#{Attachment.table_name}.*",
|
: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 )"}
|
: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',
|
acts_as_activity_provider :type => 'files',
|
||||||
|
:is_public => 'attachments.is_public',
|
||||||
:permission => :view_files,
|
:permission => :view_files,
|
||||||
:author_key => :author_id,
|
: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 " +
|
: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 )"}
|
"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',
|
acts_as_activity_provider :type => 'documents',
|
||||||
|
:is_public => 'documents.is_public',
|
||||||
:permission => :view_documents,
|
:permission => :view_documents,
|
||||||
:author_key => :author_id,
|
:author_key => :author_id,
|
||||||
:find_options => {:select => "#{Attachment.table_name}.*",
|
:find_options => {:select => "#{Attachment.table_name}.*",
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Course < ActiveRecord::Base
|
||||||
has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
|
has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
|
||||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||||
has_many :homework_for_courses, :dependent => :destroy
|
has_many :homework_for_courses, :dependent => :destroy
|
||||||
has_many :student, :through => :students_for_courses, :source => :user
|
has_many :student, :class_name => 'StudentsForCourse', :source => :user
|
||||||
has_many :course_infos, :class_name => 'CourseInfos',:dependent => :destroy
|
has_many :course_infos, :class_name => 'CourseInfos',:dependent => :destroy
|
||||||
has_many :enabled_modules, :dependent => :delete_all
|
has_many :enabled_modules, :dependent => :delete_all
|
||||||
has_many :boards, :dependent => :destroy, :order => "position ASC"
|
has_many :boards, :dependent => :destroy, :order => "position ASC"
|
||||||
|
@ -39,7 +39,7 @@ class Course < ActiveRecord::Base
|
||||||
validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
|
validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
|
||||||
|
|
||||||
before_save :self_validate
|
before_save :self_validate
|
||||||
after_save :create_board_sync
|
after_create :create_board_sync
|
||||||
before_destroy :delete_all_members
|
before_destroy :delete_all_members
|
||||||
|
|
||||||
safe_attributes 'extra',
|
safe_attributes 'extra',
|
||||||
|
@ -104,7 +104,24 @@ class Course < ActiveRecord::Base
|
||||||
|
|
||||||
# 课程的短描述信息
|
# 课程的短描述信息
|
||||||
def short_description(length = 255)
|
def short_description(length = 255)
|
||||||
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||||
|
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||||
|
end
|
||||||
|
|
||||||
|
# 课程的短名称信息
|
||||||
|
def short_name(length = 8)
|
||||||
|
name.gsub(/<\/?.*?>/,"").html_safe if name
|
||||||
|
end
|
||||||
|
|
||||||
|
def strip_html(html)
|
||||||
|
return html if html.empty? || !html.include?('<')
|
||||||
|
output = ""
|
||||||
|
tokenizer = HTML::Tokenizer.new(html)
|
||||||
|
while token = tokenizer.next
|
||||||
|
node = HTML::Node.parse(nil, 0, 0, token, false)
|
||||||
|
output += token unless (node.kind_of? HTML::Tag) or (token =~ /^<!/)
|
||||||
|
end
|
||||||
|
return output
|
||||||
end
|
end
|
||||||
|
|
||||||
def extra_frozen?
|
def extra_frozen?
|
||||||
|
@ -288,7 +305,7 @@ class Course < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
#项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题
|
#项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题
|
||||||
def name
|
#def name
|
||||||
read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
|
# read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
|
||||||
end
|
#end
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,7 +30,8 @@ class Document < ActiveRecord::Base
|
||||||
acts_as_event :title => Proc.new {|o| "#{l(:label_document)}: #{o.title}"},
|
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) },
|
: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}}
|
: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_presence_of :project, :title, :category
|
||||||
validates_length_of :title, :maximum => 60
|
validates_length_of :title, :maximum => 60
|
||||||
|
@ -39,7 +40,7 @@ class Document < ActiveRecord::Base
|
||||||
includes(:project).where(Project.allowed_to_condition(args.shift || User.current, :view_documents, *args))
|
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)
|
def visible?(user=User.current)
|
||||||
!user.nil? && user.allowed_to?(:view_documents, project)
|
!user.nil? && user.allowed_to?(:view_documents, project)
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
class FirstPage < ActiveRecord::Base
|
||||||
|
attr_accessible :description, :title, :web_title,:page_type,:sort_type
|
||||||
|
validates_presence_of :web_title, :title, :description,:page_type
|
||||||
|
validates_length_of :web_title,:title, maximum: 30
|
||||||
|
validates_length_of :description, maximum: 100
|
||||||
|
end
|
|
@ -562,6 +562,14 @@ class Issue < ActiveRecord::Base
|
||||||
@workflow_rule_by_attribute = result if user.nil?
|
@workflow_rule_by_attribute = result if user.nil?
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
# 缺陷的短描述信息
|
||||||
|
def short_description(length = 255)
|
||||||
|
# 不再使用短描述
|
||||||
|
#description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||||
|
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||||
|
description
|
||||||
|
end
|
||||||
|
|
||||||
private :workflow_rule_by_attribute
|
private :workflow_rule_by_attribute
|
||||||
|
|
||||||
def done_ratio
|
def done_ratio
|
||||||
|
@ -1513,4 +1521,6 @@ class Issue < ActiveRecord::Base
|
||||||
def be_user_score_new_issue
|
def be_user_score_new_issue
|
||||||
UserScore.project(:post_issue, User.current,self, { issue_id: self.id })
|
UserScore.project(:post_issue, User.current,self, { issue_id: self.id })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -74,6 +74,14 @@ class News < ActiveRecord::Base
|
||||||
visible(user).includes([:author, :project]).order("#{News.table_name}.created_on DESC").limit(count).all
|
visible(user).includes([:author, :project]).order("#{News.table_name}.created_on DESC").limit(count).all
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 新闻的短描述信息
|
||||||
|
def short_description(length = 255)
|
||||||
|
#description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||||
|
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||||
|
# 不再使用短描述
|
||||||
|
description
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def add_author_as_watcher
|
def add_author_as_watcher
|
||||||
|
|
|
@ -84,7 +84,10 @@ class OpenSourceProject < ActiveRecord::Base
|
||||||
# end
|
# end
|
||||||
|
|
||||||
def short_description(length = 255)
|
def short_description(length = 255)
|
||||||
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||||
|
#description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||||
|
# 不再使用短描述
|
||||||
|
description
|
||||||
end
|
end
|
||||||
|
|
||||||
def applied_by?(user)
|
def applied_by?(user)
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Project < ActiveRecord::Base
|
||||||
has_many :principals, :through => :member_principals, :source => :principal
|
has_many :principals, :through => :member_principals, :source => :principal
|
||||||
has_many :enabled_modules, :dependent => :delete_all
|
has_many :enabled_modules, :dependent => :delete_all
|
||||||
has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
|
has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
|
||||||
has_many :issues, :dependent => :destroy, :include => [:status, :tracker] , :order => "id ASC"
|
has_many :issues, :dependent => :destroy, :include => [:status, :tracker]
|
||||||
has_many :issue_changes, :through => :issues, :source => :journals
|
has_many :issue_changes, :through => :issues, :source => :journals
|
||||||
has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
|
has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
|
||||||
has_many :time_entries, :dependent => :delete_all
|
has_many :time_entries, :dependent => :delete_all
|
||||||
|
@ -127,7 +127,7 @@ class Project < ActiveRecord::Base
|
||||||
after_save :update_position_under_parent, :if => Proc.new {|project| project.name_changed?}
|
after_save :update_position_under_parent, :if => Proc.new {|project| project.name_changed?}
|
||||||
after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?}
|
after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?}
|
||||||
# 创建project之后默认创建一个board,之后的board去掉了board的概念
|
# 创建project之后默认创建一个board,之后的board去掉了board的概念
|
||||||
after_save :create_board_sync
|
after_create :create_board_sync
|
||||||
before_destroy :delete_all_members
|
before_destroy :delete_all_members
|
||||||
def remove_references_before_destroy
|
def remove_references_before_destroy
|
||||||
return if self.id.nil?
|
return if self.id.nil?
|
||||||
|
@ -156,7 +156,7 @@ class Project < ActiveRecord::Base
|
||||||
where(nil)
|
where(nil)
|
||||||
else
|
else
|
||||||
pattern = "%#{arg.to_s.strip.downcase}%"
|
pattern = "%#{arg.to_s.strip.downcase}%"
|
||||||
where("LOWER(identifier) LIKE :p OR LOWER(name) LIKE :p ", :p => pattern)
|
where("LOWER(name) LIKE :p ", :p => pattern)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
scope :project_entities, -> { where(project_type: ProjectType_project) }
|
scope :project_entities, -> { where(project_type: ProjectType_project) }
|
||||||
|
@ -629,7 +629,10 @@ class Project < ActiveRecord::Base
|
||||||
|
|
||||||
# Returns a short description of the projects (first lines)
|
# Returns a short description of the projects (first lines)
|
||||||
def short_description(length = 255)
|
def short_description(length = 255)
|
||||||
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||||
|
# 不再使用短描述
|
||||||
|
# description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||||
|
description
|
||||||
end
|
end
|
||||||
|
|
||||||
def css_classes
|
def css_classes
|
||||||
|
|
|
@ -163,7 +163,7 @@ class Setting < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
# fixed domain url in development. tantantan's bug
|
# fixed domain url in development. tantantan's bug
|
||||||
if Rails.env.development?
|
if Rails.env.development? || Rails.env.test?
|
||||||
methods.map do |m|
|
methods.map do |m|
|
||||||
define_singleton_method m do; nil; end if m.to_s =~ /([a-zA-Z]+_domain)$/
|
define_singleton_method m do; nil; end if m.to_s =~ /([a-zA-Z]+_domain)$/
|
||||||
end
|
end
|
||||||
|
|
|
@ -996,4 +996,4 @@ class AnonymousUser < User
|
||||||
def destroy
|
def destroy
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
<h3><%=l(:label_first_page_made)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'admin', :action => 'contest_page_made') do %>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||||
|
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<div class="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><%= link_to l(:label_project_first_page), {:action => 'first_page_made'} %></li>
|
||||||
|
<li><%= link_to l(:label_course_first_page), {:action => 'course_page_made'} %></li>
|
||||||
|
<li><%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'} , :class => 'selected'%></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4><%=l(:label_contest_first_page)%></h4>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||||
|
</p>
|
||||||
|
<div style="margin-left: 82px;" id="avatar">
|
||||||
|
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@contest_page} %>
|
||||||
|
</div>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='contest_title'> <%= l(:label_site_title) %>:</label>
|
||||||
|
<%= text_field_tag 'contest_title', params[:label_site_title], :value => @contest_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='contest_description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||||
|
<%= text_area_tag 'contest_description',@contest_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -0,0 +1,37 @@
|
||||||
|
<h3><%=l(:label_first_page_made)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'admin', :action => 'course_page_made') do %>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||||
|
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<div class="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><%= link_to l(:label_project_first_page), {:action => 'first_page_made'} %></li>
|
||||||
|
<li><%= link_to l(:label_course_first_page), {:action => 'course_page_made'}, :class => 'selected' %></li>
|
||||||
|
<li><%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'} %></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<h4><%=l(:label_course_first_page)%></h4>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||||
|
</p>
|
||||||
|
<div style="margin-left: 82px;" id="avatar">
|
||||||
|
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@course_page} %>
|
||||||
|
</div>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='course_title'> <%= l(:label_site_title) %>:</label>
|
||||||
|
<%= text_field_tag 'course_title', params[:label_site_title], :value => @course_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='course_description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||||
|
<%= text_area_tag 'course_description',@course_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -0,0 +1,46 @@
|
||||||
|
<h3><%=l(:label_first_page_made)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'admin', :action => 'first_page_made') do %>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||||
|
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<div class="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><%= link_to l(:label_project_first_page), {:action => 'first_page_made'}, :class => 'selected' %></li>
|
||||||
|
<li><%= link_to l(:label_course_first_page), {:action => 'course_page_made'} %></li>
|
||||||
|
<li><%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'} %></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<h4><%=l(:label_project_first_page)%></h4>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||||
|
</p>
|
||||||
|
<div style="margin-left: 82px;" id="avatar">
|
||||||
|
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@first_page} %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='title'> <%= l(:label_site_title) %>:</label>
|
||||||
|
<%= text_field_tag 'title', params[:label_site_title], :value => @first_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||||
|
<%= text_area_tag 'description',@first_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='sort_type' style="vertical-align: top"> <%= l(:label_sort_type)%>:</label>
|
||||||
|
<select name="sort_type" id="sort_type" style="font-size:small;width:496px;margin-left:80px;">
|
||||||
|
<option value="1" <%= "selected=selected" if @first_page.sort_type == 1 %>><%= l(:label_sort_by_active) %></option>
|
||||||
|
<option value="2" <%= "selected=selected" if @first_page.sort_type == 2 %>><%= l(:label_sort_by_influence) %></option>
|
||||||
|
<option value="0" <%= "selected=selected" if @first_page.sort_type == 0 %>><%= l(:label_sort_by_time) %></option>
|
||||||
|
</select>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -0,0 +1,31 @@
|
||||||
|
<h3><%=l(:label_first_page_made)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'admin', :action => 'first_page_made') do %>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||||
|
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<h4><%=l(:label_project_first_page)%></h4>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||||
|
</p>
|
||||||
|
<div style="margin-left: 82px;">
|
||||||
|
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@first_page} %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='title'> <%= l(:label_site_title) %>:</label>
|
||||||
|
<%= text_field_tag 'title', params[:label_site_title], :value => @first_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||||
|
<%= text_area_tag 'description',@first_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -1,3 +1,4 @@
|
||||||
|
<div id="avatardiv">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
a, a:hover {text-decoration:none;}
|
a, a:hover {text-decoration:none;}
|
||||||
.btn_addPic
|
.btn_addPic
|
||||||
|
@ -42,9 +43,11 @@
|
||||||
<div id="upload_progressbar" style="height:14px; margin-bottom: 10px;display: block"></div>
|
<div id="upload_progressbar" style="height:14px; margin-bottom: 10px;display: block"></div>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<a href="javascript:void(0);" class="btn_addPic" style="text-decoration:none;">
|
<%= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "btn_addPic", :style => "text-decoration:none;" %>
|
||||||
|
<a href="javascript:void(0);" class="btn_addPic" style="text-decoration:none;">
|
||||||
<span><%= l(:button_upload_photo) %></span>
|
<span><%= l(:button_upload_photo) %></span>
|
||||||
</a>
|
</a>
|
||||||
|
<!-- :accept => 'image/png,image/gif,image/jpeg', -->
|
||||||
<span class="add_avatar" style="margin-left: -55px;width: 70px">
|
<span class="add_avatar" style="margin-left: -55px;width: 70px">
|
||||||
<%= file_field_tag 'avatar[image]',
|
<%= file_field_tag 'avatar[image]',
|
||||||
:id => nil,
|
:id => nil,
|
||||||
|
@ -57,6 +60,8 @@
|
||||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||||
|
:file_type => Redmine::Configuration['pic_types'].to_s,
|
||||||
|
:type_support_message => l(:error_pic_type),
|
||||||
:upload_path => upload_avatar_path(:format => 'js'),
|
:upload_path => upload_avatar_path(:format => 'js'),
|
||||||
:description_placeholder => nil ,# l(:label_optional_description)
|
:description_placeholder => nil ,# l(:label_optional_description)
|
||||||
:source_type => source.class.to_s,
|
:source_type => source.class.to_s,
|
||||||
|
@ -67,3 +72,4 @@
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
<%= javascript_include_tag 'avatars' %>
|
<%= javascript_include_tag 'avatars' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
|
@ -0,0 +1,5 @@
|
||||||
|
var avatardiv = $('#avatardiv');
|
||||||
|
avatardiv.replaceWith("<%= escape_javascript(render :partial=>'avatar/avatar_form',:style => 'display:inline',:locals=> {source:@source}) %>");
|
||||||
|
//var imgSpan = $('#avatar_image');
|
||||||
|
|
||||||
|
//imgSpan.attr({"src":'<#%= @urlfile.to_s << "?" << Time.now.to_s%>'});
|
|
@ -86,10 +86,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td style="width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||||
<strong>开发项目</strong>:
|
<strong>开发项目</strong>:
|
||||||
<% if homework.project != nil %>
|
<% if homework.project != nil %>
|
||||||
|
<span title="<%= homework.project.name %>">
|
||||||
<%= link_to homework.project.name,project_path(homework.project.id)%>
|
<%= link_to homework.project.name,project_path(homework.project.id)%>
|
||||||
|
</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
暂无
|
暂无
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% if @bid.homework_type == Bid::HomeworkFile %>
|
<% if @bid.homework_type %>
|
||||||
<!-- 提交文件类型 -->
|
<!-- 提交文件类型 -->
|
||||||
<%= render :partial => 'homework' %>
|
<%= render :partial => 'homework' %>
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,19 @@
|
||||||
<% contests.each do |contest|%>
|
<% contests.each do |contest|%>
|
||||||
<table width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
|
<table width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), user_path(contest.author), :class => "avatar") %></td>
|
<td colspan="2" valign="top" width="50" >
|
||||||
|
<% unless contest.author.nil? %>
|
||||||
|
<%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), user_path(contest.author), :class => "avatar") %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<table width="100%" border="0">
|
<table width="100%" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" valign="top"><strong><%= 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") %></strong></td>
|
<td colspan="2" valign="top"><strong>
|
||||||
|
<% 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") %></strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="500">
|
<td width="500">
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%>
|
<%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%>
|
||||||
<% @admin = @course.course_infos%>
|
<% @admin = @course.course_infos%>
|
||||||
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
|
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
|
||||||
<!-- <%= @admin.first.user.user_extensions.occupation %> -->
|
<!-- <%#= @admin.first.user.user_extensions.occupation %> -->
|
||||||
<% unless @course.teacher.user_extensions.school.nil? %>
|
<% unless @course.teacher.user_extensions.school.nil? %>
|
||||||
<%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %>
|
<%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<%= content_tag('a', @admin.collect{|u| link_to(u.user.lastname+u.user.firstname, user_path(u.user_id))}.join(", ").html_safe) %>
|
<%= content_tag('a', @admin.collect{|u| link_to(u.user.lastname+u.user.firstname, user_path(u.user_id))}.join(", ").html_safe) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="information_for_course" >
|
<div class="information_for_course" >
|
||||||
|
@ -76,6 +76,10 @@
|
||||||
|
|
||||||
<div class="add-info" style="margin-left: 30px; margin-top: -20px">
|
<div class="add-info" style="margin-left: 30px; margin-top: -20px">
|
||||||
<%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %>
|
<%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %>
|
||||||
|
<%# desc = course.short_description.nil? ? "" : course.short_description%>
|
||||||
|
<!--<#div class="brief_introduction" title="<%#= desc.html_safe%>">
|
||||||
|
<%#= desc.html_safe%>
|
||||||
|
</div>-->
|
||||||
<%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
|
<%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
<div id="courses-index">
|
<div id="courses-index">
|
||||||
<%if @courses%>
|
<%if @courses%>
|
||||||
<%= render_course_hierarchy(@courses)%>
|
<%= render_course_hierarchy(@courses)%>
|
||||||
|
<%#= render :partial => 'course', :locals => {:course => @courses.first}%>
|
||||||
|
<%#= "<a herf = 'aaa'>hello</a>".html_safe %>
|
||||||
<%end%>
|
<%end%>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -58,39 +58,65 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
<% if (@events_pages.page == @events_pages.last_page) %>
|
||||||
|
<div class="font_description">
|
||||||
|
<table width="660">
|
||||||
|
<tr>
|
||||||
|
<td><%= image_tag(url_to_avatar(@user), :class => "avatar") %></td>
|
||||||
|
<td colspan="2">
|
||||||
|
<table width="580">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<% if @canShowRealName %>
|
||||||
|
(<%= link_to_user(@user, @canShowRealName) %>
|
||||||
|
)
|
||||||
|
<% else %>
|
||||||
|
<%= link_to_user(@user)%>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= l(:label_user_create_project) %> <%= link_to @course.name %>
|
||||||
|
<strong> !</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="font_lighter" style="float: right"><%= l :label_create_time %>
|
||||||
|
: <%= format_time(@course.created_at) %>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<%else%>
|
||||||
|
<div class="font_description">
|
||||||
|
<table width="660">
|
||||||
|
<tr>
|
||||||
|
<td><%= image_tag(url_to_avatar(@user), :class => "avatar") %></td>
|
||||||
|
<td colspan="2">
|
||||||
|
<table width="580">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<% if @canShowRealName %>
|
||||||
|
(<%= link_to_user(@user, @canShowRealName) %>
|
||||||
|
)
|
||||||
|
<% else %>
|
||||||
|
<%= link_to_user(@user)%>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= l(:label_user_create_project) %> <%= link_to @course.name %>
|
||||||
|
<strong> !</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="font_lighter" style="float: right"><%= l :label_create_time %>
|
||||||
|
: <%= format_time(@course.created_at) %>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="font_description">
|
|
||||||
<table width="660">
|
|
||||||
<tr>
|
|
||||||
<td><%= image_tag(url_to_avatar(@user), :class => "avatar") %></td>
|
|
||||||
<td colspan="2">
|
|
||||||
<table width="580">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<%
|
|
||||||
#判断是否显示真名
|
|
||||||
if @canShowRealName
|
|
||||||
%>
|
|
||||||
<%= link_to (h @user.try(:name)), user_path(@user) if @user %>
|
|
||||||
(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>)
|
|
||||||
<% else %>
|
|
||||||
<%= link_to (h @user.try(:name)), user_path(@user) if @user %>
|
|
||||||
<% end %>
|
|
||||||
<%= l(:label_user_create_project) %> <%= link_to @course.name %>
|
|
||||||
<strong> !</strong></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="font_lighter" style="float: right"><%= l :label_create_time %>
|
|
||||||
: <%= format_time(@course.created_at) %>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<%= error_messages_for @document %>
|
<%= error_messages_for @document %>
|
||||||
|
|
||||||
<div class="box tabular">
|
<div class="box tabular">
|
||||||
<p><%= f.select :category_id, DocumentCategory.active.collect {|c| [c.name, c.id]} %></p>
|
<p><%= f.select :category_id, DocumentCategory.active.collect {|c| [c.name, c.id]} %> </p>
|
||||||
|
<p> <em style ="display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %>
|
||||||
|
<%= l(:label_document_public_info) %></em>
|
||||||
|
</p>
|
||||||
<p><%= f.text_field :title, :required => true, :size => 60 %></p>
|
<p><%= f.text_field :title, :required => true, :size => 60 %></p>
|
||||||
<p><%= f.text_area :description, :cols => 60, :rows => 15, :class => 'wiki-edit' %></p>
|
<p><%= f.text_area :description, :cols => 60, :rows => 15, :class => 'wiki-edit' %></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
<div id="file_buttons" class="nhidden">
|
<div id="file_buttons" class="nhidden">
|
||||||
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @course) %>
|
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @course) %>
|
||||||
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @course) %>
|
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @course) %>
|
||||||
|
<p></p>
|
||||||
|
<div class="box" id="files-box">
|
||||||
|
<label for="files-box" style="font-weight:bold;"> <%= l(:label_files_filter) %></label>
|
||||||
<% if attachmenttypes.any? %>
|
<% if attachmenttypes.any? %>
|
||||||
|
|
||||||
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
|
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
|
||||||
|
@ -24,7 +26,7 @@
|
||||||
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
|
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
|
||||||
:onchange => "course_attachment_contenttypes_searchex(this.value)" %>
|
:onchange => "course_attachment_contenttypes_searchex(this.value)" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
<div id="upload_file_div" class="relation_file_div hidden">
|
<div id="upload_file_div" class="relation_file_div hidden">
|
||||||
<%= render :partial => 'course_new', locals: {course: @course} %>
|
<%= render :partial => 'course_new', locals: {course: @course} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% container.attachments.each do |file| %>
|
<% 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%>
|
<%next%>
|
||||||
<%end%>
|
<%end%>
|
||||||
<tr class="file <%= cycle("odd", "odd") %>">
|
<tr class="file <%= cycle("odd", "odd") %>">
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<% @containers.each do |container| %>
|
<% @containers.each do |container| %>
|
||||||
<% next if container.attachments.empty? -%>
|
<% next if container.attachments.empty? -%>
|
||||||
<% container.attachments.each do |file| %>
|
<% 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 %>
|
<% next %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if isTypeOk(file, selAttachType, selContentType) %>
|
<% if isTypeOk(file, selAttachType, selContentType) %>
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
<div id="file_buttons" class="nhidden">
|
<div id="file_buttons" class="nhidden">
|
||||||
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %>
|
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %>
|
||||||
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
|
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
|
||||||
|
<p></p>
|
||||||
|
<div class="box" id="files-box">
|
||||||
|
<label for="files-box" style="font-weight:bold;"> <%= l(:label_files_filter) %></label>
|
||||||
<% if attachmenttypes.any? %>
|
<% if attachmenttypes.any? %>
|
||||||
|
|
||||||
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
|
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
|
||||||
|
@ -24,6 +26,7 @@
|
||||||
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
|
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
|
||||||
:onchange => "attachment_contenttypes_searchex(this.value)" %>
|
:onchange => "attachment_contenttypes_searchex(this.value)" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="upload_file_div" class="relation_file_div hidden">
|
<div id="upload_file_div" class="relation_file_div hidden">
|
||||||
<%= render :partial => 'new', locals: {project: @project} %>
|
<%= render :partial => 'new', locals: {project: @project} %>
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
<% if forums.any? %>
|
<% if forums.any? %>
|
||||||
<% forums.each do |forum| %>
|
<% forums.each do |forum| %>
|
||||||
<div class="forums-index">
|
<div class="forums-index">
|
||||||
<div class="forums-inex-avatar"><%= link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator) %></div>
|
<div class="forums-inex-avatar">
|
||||||
|
<% unless forum.creator.nil? %>
|
||||||
|
<%= link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator) %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
<div class="forums-index-content">
|
<div class="forums-index-content">
|
||||||
<p ><%= link_to h(forum.name), forum_path(forum) %></p>
|
<p ><%= link_to h(forum.name), forum_path(forum) %></p>
|
||||||
<p ><%= forum.description%></p>
|
<p ><%= forum.description%></p>
|
||||||
|
|
|
@ -24,6 +24,21 @@
|
||||||
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
|
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
|
||||||
<p><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p>
|
<p><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
<div class="box tabular" >
|
||||||
|
<p id="watchers_form">
|
||||||
|
<label style="font-size: 15px;"><%= l(:label_issue_watchers) %></label>
|
||||||
|
<span id="watchers_inputs" style="font-size: 15px;">
|
||||||
|
<%= watchers_checkboxes(@issue, @available_watchers) %>
|
||||||
|
</span>
|
||||||
|
<span class="search_for_watchers" style="font-size: 15px;">
|
||||||
|
<%= link_to l(:label_search_for_watchers),
|
||||||
|
{:controller => 'watchers', :action => 'new', :project_id => @issue.project},
|
||||||
|
:remote => true,
|
||||||
|
:method => 'get' %>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= f.hidden_field :lock_version %>
|
<%= f.hidden_field :lock_version %>
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<ul class="list-group-item-meta">
|
<ul class="list-group-item-meta">
|
||||||
<div class="issue-list-description">
|
<div class="issue-list-description">
|
||||||
<%= l(:field_description)%>: <%= issue.description %>
|
<%= l(:field_description)%>: <%= issue.short_description %>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="list-group-item-meta">
|
<ul class="list-group-item-meta">
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<ul class="course_sub_menu">
|
<ul class="course_sub_menu">
|
||||||
<% User.current.courses.each do |course| %>
|
<% User.current.courses.each do |course| %>
|
||||||
<% if !course_endTime_timeout?(course) %>
|
<% if !course_endTime_timeout?(course) %>
|
||||||
<li><%= link_to course.name, course_path(course) %></li>
|
<li><%= link_to course.name.truncate(10, omission: '...'), {:controller => 'courses',:action => 'show',id:course.id} %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
<li id="project_loggedas_li"><%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
|
<li id="project_loggedas_li"><%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
|
||||||
<ul class="project_sub_menu">
|
<ul class="project_sub_menu">
|
||||||
<% User.current.projects.each do |project| %>
|
<% User.current.projects.each do |project| %>
|
||||||
<li><%= link_to project.name, project_path(project) %></li>
|
<li><%= link_to project.name.truncate(10, omission: '...'), {:controller => 'projects', :action => 'show',id: project.id } %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding-left: 8px"><%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %></td>
|
<td style="padding-left: 8px"><%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %></td>
|
||||||
<td><p class="top-content-list"><%= link_to "主页", home_path %>
|
<td><p class="top-content-list"><%= link_to "主页", home_path %>
|
||||||
> <%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %>
|
> <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %>
|
||||||
> <%= link_to @course.name, nil %></p></td>
|
> <%= link_to @course.name, nil %></p></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -183,12 +183,12 @@
|
||||||
<!--description-->
|
<!--description-->
|
||||||
<div class="inf_user_context">
|
<div class="inf_user_context">
|
||||||
<div class="font_title_left">
|
<div class="font_title_left">
|
||||||
<%= l(:label_course_overview) %>
|
<%= l(:label_new_course_description) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="padding-bottom: 8px">
|
<div style="padding-bottom: 8px">
|
||||||
<% if @course.description && @course.description.size>0 %>
|
<% if @course.description && @course.description.size>0 %>
|
||||||
<div class="font_lighter_sidebar">
|
<div class="font_lighter_sidebar" style="word-break:break-all; word-wrap:break-all;">
|
||||||
|
|
||||||
<%= textilizable @course.description %>
|
<%= textilizable @course.description %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @nav_dispaly_project_label = 1 %>
|
<% #@nav_dispaly_project_label = 1 %>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
|
|
||||||
<strong class="font_small_watch"><%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %></strong>
|
<strong class="font_small_watch"><%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %></strong>
|
||||||
|
|
||||||
<strong class="font_small_watch"><%= link_to l(:label_requirement_focus)+"("+Bid.watched_by(@user).where('reward_type = ?', 1).count.to_s+")" ,:controller=>"users", :action=>"watch_bids"%></strong> <!-- added by huang -->
|
<!-- <strong class="font_small_watch"><%= link_to l(:label_requirement_focus)+"("+Bid.watched_by(@user).where('reward_type = ?', 1).count.to_s+")" ,:controller=>"users", :action=>"watch_bids"%></strong>--> <!-- added by huang -->
|
||||||
<!-- added by bai 个人签名-->
|
<!-- added by bai 个人签名-->
|
||||||
<% if @user.id == User.current.id %>
|
<% if @user.id == User.current.id %>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -36,20 +36,21 @@
|
||||||
<%= error_messages_for 'user' %>
|
<%= error_messages_for 'user' %>
|
||||||
|
|
||||||
<fieldset class="box" style="margin:10px;">
|
<fieldset class="box" style="margin:10px;">
|
||||||
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
|
|
||||||
<legend onclick="toggleFieldset(this);">
|
|
||||||
<%= l(:label_my_photo) %>
|
|
||||||
</legend>
|
|
||||||
<div>
|
|
||||||
<!--upload profiles-->
|
|
||||||
<%= render :partial => "avatar/avatar_form", :locals => {source: @user} %>
|
|
||||||
<!--upload-->
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
<%= labelled_form_for :user, @user,
|
<%= labelled_form_for :user, @user,
|
||||||
:url => {:action => "account"},
|
:url => {:action => "account"},
|
||||||
:html => {:id => 'my_account_form',
|
:html => {:id => 'my_account_form',
|
||||||
:method => :post} do |f| %>
|
:method => :post} do |f| %>
|
||||||
|
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
|
||||||
|
<legend onclick="toggleFieldset(this);">
|
||||||
|
<%= l(:label_my_photo) %>
|
||||||
|
</legend>
|
||||||
|
<div>
|
||||||
|
<!--upload profiles-->
|
||||||
|
<%= render :partial => "avatar/avatar_form",:style => "display:inline", :locals => {source: @user} %>
|
||||||
|
<!--upload-->
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
|
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
|
||||||
<legend onclick="toggleFieldset(this);">
|
<legend onclick="toggleFieldset(this);">
|
||||||
<%= l(:label_information_plural) %>
|
<%= l(:label_information_plural) %>
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
<!-- <p style="margin-left:-10px;"><%#= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %></p> --> <!-- by huang -->
|
<!-- <p style="margin-left:-10px;"><%#= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %></p> --> <!-- by huang -->
|
||||||
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></em></p>
|
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></em></p>
|
||||||
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :hidden_repo, :style => "margin-left:10px;" %></em></p>
|
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :hidden_repo, :style => "margin-left:10px;" %></em></p>
|
||||||
|
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;">
|
||||||
|
<%= f.check_box :dts_test, :style => "margin-left:10px;" %>
|
||||||
|
</em></p>
|
||||||
<p style="display:none;"><%= f.text_field :project_type, :value => 0 %></p>
|
<p style="display:none;"><%= f.text_field :project_type, :value => 0 %></p>
|
||||||
|
|
||||||
<%= wikitoolbar_for 'project_description' %>
|
<%= wikitoolbar_for 'project_description' %>
|
||||||
|
|
|
@ -18,18 +18,40 @@
|
||||||
|
|
||||||
<div class="information">
|
<div class="information">
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<strong><span style="font-size: 17px;margin-left: 145px"><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></span></strong>
|
<table style="padding-left: 100px">
|
||||||
<%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
|
<tr>
|
||||||
</p>
|
<td style="width: 40%;text-align: right;font-size: 17px;">
|
||||||
<p class="stats">
|
<strong><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></strong>
|
||||||
<strong><span style="font-size: 17px;margin-left: 145px"><%= link_to "#{@project.members.count}", project_member_path(@project)%></span></strong>
|
</td>
|
||||||
<%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
|
<td style="width: 60%;text-align: left">
|
||||||
</p>
|
<%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
|
||||||
<p class="stats">
|
</td>
|
||||||
<%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %><%= content_tag('span', l(:label_since_last_commits)) %>
|
</tr>
|
||||||
</p>
|
<tr>
|
||||||
<p class="stats">
|
<td style="width: 40%;text-align: right;font-size: 17px;">
|
||||||
<%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %><%= content_tag('span', l(:label_commit_on)) %>
|
<strong><%= link_to "#{@project.members.count}", project_member_path(@project)%></strong>
|
||||||
|
</td>
|
||||||
|
<td style="width: 60%;text-align: left">
|
||||||
|
<%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||||
|
<strong><%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %></strong>
|
||||||
|
</td>
|
||||||
|
<td style="width: 60%;text-align: left">
|
||||||
|
<%= content_tag('span', l(:label_since_last_commits)) %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||||
|
<strong><%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %></strong>
|
||||||
|
</td>
|
||||||
|
<td style="width: 60%;text-align: left">
|
||||||
|
<%= content_tag('span', l(:label_commit_on)) %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -120,9 +142,9 @@
|
||||||
<%= l(:label_project_grade)%>:
|
<%= l(:label_project_grade)%>:
|
||||||
<span >
|
<span >
|
||||||
<%= link_to(format("%.2f" , finall_project_score ).to_f,
|
<%= link_to(format("%.2f" , finall_project_score ).to_f,
|
||||||
{:controller => 'projects',
|
{:controller => 'projects',
|
||||||
:action => 'show_projects_score',
|
:action => 'show_projects_score',
|
||||||
:remote => true, :id => @project.id}, :style=>"color: #EC6300;") %>
|
:remote => true, :id => @project.id}, :style=>"color: #EC6300;") %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
<li><%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %></li>
|
<li><%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul><h3>其他工具</h3>
|
<ul><h3>其他工具</h3>
|
||||||
<li><%= link_to l(:label_module_share) ,share_show_path(@project) %></li>
|
<% if @project.dts_test == 1 %>
|
||||||
|
<li><%= link_to l(:label_module_share) ,share_show_path(@project) %></li>
|
||||||
|
<% end %>
|
||||||
<li><%= link_to l(:project_module_documents), project_documents_path(@project) %></li>
|
<li><%= link_to l(:project_module_documents), project_documents_path(@project) %></li>
|
||||||
<li></li>
|
<li></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -5,17 +5,22 @@
|
||||||
<div class="box tabular">
|
<div class="box tabular">
|
||||||
|
|
||||||
<%= render :partial => 'course_form', :locals => { :f => f } %>
|
<%= render :partial => 'course_form', :locals => { :f => f } %>
|
||||||
<span style="padding-left: 60px"><%= submit_tag l(:button_create), :class => "enterprise"%></span>
|
<span style="padding-left: 60px">
|
||||||
<!-- <%= submit_tag l(:button_create_and_continue), :name => 'course_continue' %> -->
|
<%= submit_tag l(:button_create), :class => "enterprise"%>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<!-- <%#= submit_tag l(:button_create_and_continue), :name => 'course_continue' %> -->
|
||||||
<% else %>
|
<% else %>
|
||||||
<h3><%=l(:label_project_new)%></h3>
|
<h3><%=l(:label_project_new)%></h3>
|
||||||
<div class="box tabular" >
|
<div class="box tabular" >
|
||||||
<p style="font-weight: bold; color: rgb(237,137,36)"> <%=raw l(:label_project_new_description)%> </p>
|
<p style="font-weight: bold; color: rgb(237,137,36)"> <%=raw l(:label_project_new_description)%> </p>
|
||||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||||
<span style="padding-left: 60px"><%= submit_tag l(:button_create), :class => "enterprise"%></span>
|
<span style="padding-left: 60px">
|
||||||
<!-- <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> -->
|
<%= submit_tag l(:button_create), :class => "enterprise"%>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<!-- <%#= submit_tag l(:button_create_and_continue), :name => 'continue' %> -->
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= javascript_tag "$('#project_name').focus();" %>
|
<%= javascript_tag "$('#project_name').focus();" %>
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<!--Ended by young-->
|
<!--Ended by young-->
|
||||||
|
|
|
@ -1,77 +1,103 @@
|
||||||
<% if @events_by_day.size >0 %>
|
<% if @events_by_day.size >0 %>
|
||||||
<div class="content-title-top-avtive">
|
<div class="content-title-top-avtive">
|
||||||
<p class="subtitle">
|
<p class="subtitle">
|
||||||
<%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
|
<%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<% @events_by_day.keys.sort.reverse.each do |day| %>
|
<% @events_by_day.keys.sort.reverse.each do |day| %>
|
||||||
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
|
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
|
||||||
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;">
|
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;">
|
||||||
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
|
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
|
||||||
<%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%>
|
<%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %>
|
||||||
</div>
|
</div>
|
||||||
<div class="activity-content" style="padding:5px 5px 5px 70px;">
|
<div class="activity-content" style="padding:5px 5px 5px 70px;">
|
||||||
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
|
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
|
||||||
<span class="activity-title font_lighter">
|
<span class="activity-title font_lighter">
|
||||||
<% if @canShowRealName %>
|
<% if @canShowRealName %>
|
||||||
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>(<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %>)
|
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
|
||||||
|
(<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>)
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
|
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= l(:label_new_activity) %>
|
<%= l(:label_new_activity) %>
|
||||||
</span>
|
</span>
|
||||||
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %>
|
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %>
|
||||||
|
|
||||||
|
<div class="activity_description info-break" style="font-size: 13px;">
|
||||||
|
<%= h(truncate(strip_tags(e.event_description).gsub(/ /, ' '), length: 30, omission: '...')) %>
|
||||||
|
</div>
|
||||||
|
<div class="activity_status" style="position:relative; padding-top: 3px;">
|
||||||
|
<span class="font_lighter"> <%= l :label_activity_time %>
|
||||||
|
: <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></span>
|
||||||
|
<% if e.event_type == "issue" %>
|
||||||
|
<div class="" style="display:inline-block;position:absolute; right:2%;">
|
||||||
|
<span> <%= link_to l(:label_find_all_comments), issue_path(e) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count) %></span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="activity_description info-break" style="font-size: 13px;">
|
|
||||||
<%= h(truncate(strip_tags(e.event_description).gsub(/ /,' '), length: 30, omission:'...')) %>
|
|
||||||
</div>
|
|
||||||
<div class="activity_status" style="position:relative; padding-top: 3px;">
|
|
||||||
<span class="font_lighter"> <%= l :label_activity_time %>: <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></span>
|
|
||||||
<% if e.event_type == "issue" %>
|
|
||||||
<div class="" style="display:inline-block;position:absolute; right:2%;">
|
|
||||||
<span> <%= link_to l(:label_find_all_comments), issue_path(e) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count)%></span>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
<% end -%>
|
||||||
</div>
|
<% if (@events_pages.page == @events_pages.last_page) %>
|
||||||
</div>
|
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;">
|
||||||
|
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
|
||||||
<% end %>
|
<%= image_tag(url_to_avatar(@user), :class => "avatar") %>
|
||||||
<% end -%>
|
</div>
|
||||||
<% if(@events_pages.page == @events_pages.last_page) %>
|
<div class="activity-content" style="padding:5px 5px 5px 70px;">
|
||||||
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;">
|
|
||||||
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
|
|
||||||
<%= image_tag(url_to_avatar(@user), :class => "avatar") %>
|
|
||||||
</div>
|
|
||||||
<div class="activity-content" style="padding:5px 5px 5px 70px;">
|
|
||||||
<span class="activity-title font_lighter">
|
<span class="activity-title font_lighter">
|
||||||
<% if @canShowRealName %>
|
<% if @canShowRealName %>
|
||||||
<%= link_to (h @user.try(:name)), user_path(@user) if @user %>(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>)
|
(<%= link_to_user(@user, @canShowRealName) %>
|
||||||
<% else %>
|
)
|
||||||
<%= link_to (h @user.try(:name)), user_path(@user) if @user %>
|
<% else %>
|
||||||
<% end %>
|
<%= link_to_user(@user) %>
|
||||||
|
<% end %>
|
||||||
<%#= l(:label_new_activity) %>
|
<%#= l(:label_new_activity) %>
|
||||||
</span>
|
</span>
|
||||||
<%= l(:label_user_create_project) %> <%= link_to @project.name %><strong> !</strong>
|
<%= l(:label_user_create_project) %> <%= link_to @project.name %>
|
||||||
<div class="activity_description info-break" style="font-size: 13px;">
|
<strong> !</strong>
|
||||||
|
<div class="activity_description info-break" style="font-size: 13px;">
|
||||||
|
</div>
|
||||||
|
<div class="activity_status" style="position:relative; padding-top: 3px;">
|
||||||
|
<span class="font_lighter"><%= l :label_activity_time %>: <%= format_time(@project.created_on) %></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;">
|
||||||
|
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
|
||||||
|
<%= image_tag(url_to_avatar(@user), :class => "avatar") %>
|
||||||
</div>
|
</div>
|
||||||
<div class="activity_status" style="position:relative; padding-top: 3px;">
|
<div class="activity-content" style="padding:5px 5px 5px 70px;">
|
||||||
<span class="font_lighter"><%= l :label_activity_time %>: <%= format_time(@project.created_on) %></span>
|
<span class="activity-title font_lighter">
|
||||||
|
<% if @canShowRealName %>
|
||||||
|
(<%= link_to_user(@user, @canShowRealName) %>
|
||||||
|
)
|
||||||
|
<% else %>
|
||||||
|
<%= link_to_user(@user) %>
|
||||||
|
<% end %>
|
||||||
|
<%#= l(:label_new_activity) %>
|
||||||
|
</span>
|
||||||
|
<%= l(:label_user_create_project) %> <%= link_to @project.name %>
|
||||||
|
<strong> !</strong>
|
||||||
|
<div class="activity_description info-break" style="font-size: 13px;">
|
||||||
|
</div>
|
||||||
|
<div class="activity_status" style="position:relative; padding-top: 3px;">
|
||||||
|
<span class="font_lighter"><%= l :label_activity_time %>: <%= format_time(@project.created_on) %></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<%end%>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<ul>
|
<ul>
|
||||||
<%= pagination_links_full @events_pages%>
|
<%= pagination_links_full @events_pages %>
|
||||||
<% #binding.pry %>
|
<% #binding.pry %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,14 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function ssearch(){
|
function ssearch(){
|
||||||
//alert($("#key_word").val());
|
//alert($("#key_word").val());
|
||||||
value = $("#key_word").val();
|
var value = $("#key_word").val();
|
||||||
province = $("#province").val();
|
var province = $("#province").val();
|
||||||
|
//alert(value);
|
||||||
|
if(value == "")
|
||||||
|
{
|
||||||
|
alert("搜索条件不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
//alert(province);
|
//alert(province);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type :"POST",
|
type :"POST",
|
||||||
|
@ -71,7 +77,9 @@
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<%= link_to "全部学校",school_index_path %>
|
<%= link_to "全部学校",school_index_path %>
|
||||||
<a href="http://course.trustie.net">我的学校</a>
|
<% if User.current.logged? %>
|
||||||
|
<a href="http://course.trustie.net">我的学校</a>
|
||||||
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li style="width: 40%; float: left">请选择省份:
|
<li style="width: 40%; float: left">请选择省份:
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" width="580">
|
<td colspan="2" width="580">
|
||||||
<p class="font_description">
|
<p class="font_description">
|
||||||
<%= membership.course.description %>
|
<%= membership.course.short_description %>
|
||||||
</p></td>
|
</p></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<div> = <%= l(:label_user_score_of_collaboration) %> + <%= l(:label_user_score_of_influence) %> +
|
<div> = <%= l(:label_user_score_of_collaboration) %> + <%= l(:label_user_score_of_influence) %> +
|
||||||
<%= l(:label_user_score_of_skill)%> + <%= l(:label_user_score_of_active) %></div>
|
<%= l(:label_user_score_of_skill)%> + <%= l(:label_user_score_of_active) %></div>
|
||||||
<!-- <div> + <%= l(:label_user_score_of_influence) %></div> -->
|
<!-- <div> + <%= l(:label_user_score_of_influence) %></div> -->
|
||||||
<div> = <%= format("%.2f" ,@user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_f %> + <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence ).to_f %>
|
<div> = <%= format("%.2f" ,@user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_i %> + <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence ).to_i %>
|
||||||
+ <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_f %> + <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_f %></div>
|
+ <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_i %> + <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_i %></div>
|
||||||
<div> = <%= format("%.2f" ,@user.user_score_attr.total_score.nil? ? 0:@user.user_score_attr.total_score).to_f %></div>
|
<div> = <%= format("%.2f" ,@user.user_score_attr.total_score.nil? ? 0:@user.user_score_attr.total_score).to_i %></div>
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<td>
|
<td>
|
||||||
<table>
|
<table>
|
||||||
<tr class="info_font"><td><%= l(:label_user_score) %></td></tr>
|
<tr class="info_font"><td><%= l(:label_user_score) %></td></tr>
|
||||||
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , @user.user_score_attr.total_score).to_f %></span></td></tr>
|
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , @user.user_score_attr.total_score).to_i %></span></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -49,23 +49,23 @@
|
||||||
<table style="border-bottom: solid 0px #80a6d2;" width="100%">
|
<table style="border-bottom: solid 0px #80a6d2;" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<%= link_to l(:label_user_score) , {:controller => 'users', :action => 'score_new_index', :remote => true} %> :
|
<%= link_to l(:label_user_score) , {:controller => 'users', :action => 'score_new_index', :remote => true} %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.total_score).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.total_score).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
<tr>
|
<tr>
|
||||||
<%= link_to l(:label_user_score_of_collaboration), {:controller => 'users',:action => 'topic_new_score_index', :remote => true} %> :
|
<%= link_to l(:label_user_score_of_collaboration), {:controller => 'users',:action => 'topic_new_score_index', :remote => true} %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
<tr>
|
<tr>
|
||||||
<%= link_to l(:label_user_score_of_influence), {:controller => 'users',:action => 'project_new_score_index', :remote => true} %> :
|
<%= link_to l(:label_user_score_of_influence), {:controller => 'users',:action => 'project_new_score_index', :remote => true} %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
<tr>
|
<tr>
|
||||||
<%= link_to l(:label_user_score_of_skill), {:controller => 'users',:action => 'activity_new_score_index', :remote => true} %> :
|
<%= link_to l(:label_user_score_of_skill), {:controller => 'users',:action => 'activity_new_score_index', :remote => true} %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
<tr>
|
<tr>
|
||||||
<%= link_to l(:label_user_score_of_active), {:controller => 'users',:action => 'influence_new_score_index', :remote => true} %> :
|
<%= link_to l(:label_user_score_of_active), {:controller => 'users',:action => 'influence_new_score_index', :remote => true} %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<%= l(:label_user_grade)%>:
|
<%= l(:label_user_grade)%>:
|
||||||
<%= link_to(format("%.2f" , user.user_score_attr.total_score).to_f, {:controller => 'users',
|
<%= link_to(format("%.2f" , user.user_score_attr.total_score).to_i, {:controller => 'users',
|
||||||
:action => 'show_new_score',
|
:action => 'show_new_score',
|
||||||
:remote => true,
|
:remote => true,
|
||||||
:id => user.id
|
:id => user.id
|
||||||
|
|
|
@ -33,21 +33,27 @@
|
||||||
<%= image_tag "/images/time_member.png", :class => "img_member_time"%>
|
<%= image_tag "/images/time_member.png", :class => "img_member_time"%>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<%= image_tag(url_to_avatar(user), :class => 'avatar') %>
|
<table style="width: 100%;table-layout: fixed">
|
||||||
<%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
|
<tr>
|
||||||
|
<td rowspan="2" style="width: 60px;">
|
||||||
<!-- modified by bai -->
|
<%= image_tag(url_to_avatar(user), :class => 'avatar') %>
|
||||||
<div style="position:relative;float:left;margin-top:-2px;margin-left: 160px">
|
</td>
|
||||||
<span style="color:#ec6300">
|
<td style="width: 200px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%= user.name %>">
|
||||||
<%= render :partial => 'users/user_score', :locals => {:user => user}%></span>
|
<span style="position: relative;font-size: 16px;display:block; "><%= link_to_user(user) %></span>
|
||||||
</div>
|
</td>
|
||||||
<!-- end -->
|
<td>
|
||||||
</div>
|
<span style="color:#ec6300">
|
||||||
|
<%= render :partial => 'users/user_score', :locals => {:user => user}%>
|
||||||
<div style="margin-top: 20px;margin-left:66px">
|
</span>
|
||||||
<%= l(:label_x_has_fans,:count=>user.watcher_users.count)%>
|
</td>
|
||||||
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<%= l(:label_x_has_fans,:count=>user.watcher_users.count)%>
|
||||||
|
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-bottom">
|
<div class="user-bottom">
|
||||||
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
|
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
|
||||||
|
|
|
@ -1,6 +1,18 @@
|
||||||
<!-- modified by huang -->
|
<!-- modified by huang -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
function searchUser(){
|
||||||
|
var name = $("#name").val();
|
||||||
|
if(name == "")
|
||||||
|
{
|
||||||
|
alert("搜索条件不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$("#search_user_form").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<div class="top-content">
|
<div class="top-content">
|
||||||
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
|
<%= form_tag( users_search_path, :method => :get, :id => 'search_user_form') do %>
|
||||||
<table width="940px">
|
<table width="940px">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="info_font" style="width: 220px; color: #15bccf" ><%= l(:label_software_user ) %></td>
|
<td class="info_font" style="width: 220px; color: #15bccf" ><%= l(:label_software_user ) %></td>
|
||||||
|
@ -9,8 +21,9 @@
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="2" >
|
<td rowspan="2" >
|
||||||
<div class="project-search" style="float: right">
|
<div class="project-search" style="float: right">
|
||||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/>
|
||||||
|
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -1,7 +1,17 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
function searchUser(){
|
||||||
|
var name = $("#name").val();
|
||||||
|
if(name == "")
|
||||||
|
{
|
||||||
|
alert("搜索条件不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$("#search_user_form").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<div class="top-content">
|
<div class="top-content">
|
||||||
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
|
<%= form_tag( users_search_path, :method => :get, :id => 'search_user_form') do %>
|
||||||
<table width="940px">
|
<table width="940px">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="info_font" style="width: 220px; color: #15bccf "><%= l(:label_software_user ) %></td>
|
<td class="info_font" style="width: 220px; color: #15bccf "><%= l(:label_software_user ) %></td>
|
||||||
|
@ -10,8 +20,9 @@
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="2" >
|
<td rowspan="2" >
|
||||||
<div class="project-search" style="float: right">
|
<div class="project-search" style="float: right">
|
||||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/>
|
||||||
|
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<div class="project-search">
|
<div class="project-search">
|
||||||
<%= text_field_tag 'user', params[:user], :size => 30 %>
|
<%= text_field_tag 'user', params[:user], :size => 30 %>
|
||||||
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
|
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -51,31 +51,31 @@
|
||||||
<% case e.act_type %>
|
<% case e.act_type %>
|
||||||
<% when 'JournalsForMessage' %>
|
<% when 'JournalsForMessage' %>
|
||||||
<% if User.current.login == e.user.try(:login) %>
|
<% if User.current.login == e.user.try(:login) %>
|
||||||
<%# if e.user_id == act.jour.id %>
|
<%# if e.user_id == act.jour.id %>
|
||||||
<tr><td colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_have_feedback) %><%=
|
<tr><td colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_have_feedback) %>
|
||||||
link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span></td></tr>
|
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span></td></tr>
|
||||||
<%# else %>
|
<%# else %>
|
||||||
<!-- <tr><td colspan="2" valign="top" class="font_lighter"><strong><%#= link_to("#{e.user.name}", user_path(e.user_id)) %> 给 <%#= link_to("#{act.at_user.name if act.at_user}", user_path(act.jour.id)) %> 留言了</strong> </td></tr> -->
|
<!-- <tr><td colspan="2" valign="top" class="font_lighter"><strong><%#= link_to("#{e.user.name}", user_path(e.user_id)) %> 给 <%#= link_to("#{act.at_user.name if act.at_user}", user_path(act.jour.id)) %> 留言了</strong> </td></tr> -->
|
||||||
<%# end %>
|
<%# end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.name}", user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_have_feedback) %><%=
|
<tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.name}", user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_have_feedback) %><%=
|
||||||
link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span></td></tr>
|
link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span></td></tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" width="580"><p class="font_description"> <%= textilizable act.notes %> </p>
|
<td colspan="2" width="580"><p class="font_description"> <%= textilizable act.notes %> </p>
|
||||||
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>
|
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>
|
||||||
</span></div>
|
</span></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
||||||
<span class="font_lighter"> <%=(l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
|
<span class="font_lighter"> <%=(l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% when 'Bid' %>
|
<% when 'Bid' %>
|
||||||
<tr>
|
<tr>
|
||||||
<% if act.reward_type ==3 %>
|
<% if act.reward_type ==3 %>
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h act.description %> </p></td> </tr>
|
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= act.description.html_safe %> </p></td> </tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to( l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %></td>
|
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to( l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h act.notes %> </p></td> </tr>
|
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= act.notes.html_safe %> </p></td> </tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></td>
|
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h act.long_comments %> </p></td> </tr>
|
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= act.long_comments.html_safe %> </p></td> </tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
||||||
|
@ -145,11 +145,11 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h act.content.truncate(240, omission: '...') %> </p></td> </tr>
|
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h act.content.truncate(240, omission: '...') %> </p></td> </tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
||||||
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
|
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% when 'Principal' %>
|
<% when 'Principal' %>
|
||||||
|
@ -161,8 +161,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<tr> <td colspan="2" width="580" > <p class="font_description"> </p></td> </tr>
|
<tr> <td colspan="2" width="580" > <p class="font_description"> </p></td> </tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
||||||
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
|
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -177,7 +177,7 @@
|
||||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %></td>
|
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h act.description %> </p></td> </tr>
|
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= act.description.html_safe %> </p></td> </tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
|
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= textilizable act.description %> </p></td> </tr>
|
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= textilizable(act.description) %> </p></td> </tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
|
||||||
|
@ -251,7 +251,7 @@
|
||||||
<td>
|
<td>
|
||||||
<table width="580" border="0">
|
<table width="580" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" valign="top"><strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
|
<td colspan="2" valign="top"><strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
|
||||||
<% if e.instance_of?(JournalsForMessage)%>
|
<% if e.instance_of?(JournalsForMessage)%>
|
||||||
<% if e.reply_id == User.current.id%>
|
<% if e.reply_id == User.current.id%>
|
||||||
<%if e.jour_type == 'Bid'%>
|
<%if e.jour_type == 'Bid'%>
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<td>
|
<td>
|
||||||
<table>
|
<table>
|
||||||
<tr class="info_font"><td><%= l(:label_user_score) %></td></tr>
|
<tr class="info_font"><td><%= l(:label_user_score) %></td></tr>
|
||||||
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , @user.user_score_attr.total_score).to_f %></span></td></tr>
|
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , @user.user_score_attr.total_score).to_i %></span></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -64,23 +64,23 @@
|
||||||
<table style="border-bottom: solid 0px #80a6d2;" width="100%">
|
<table style="border-bottom: solid 0px #80a6d2;" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<%= l(:label_user_score) %> :
|
<%= l(:label_user_score) %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.total_score).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.total_score).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
<tr>
|
<tr>
|
||||||
<%= l(:label_user_score_of_collaboration) %> :
|
<%= l(:label_user_score_of_collaboration) %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
<tr>
|
<tr>
|
||||||
<%= l(:label_user_score_of_influence) %> :
|
<%= l(:label_user_score_of_influence) %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
<tr>
|
<tr>
|
||||||
<%= l(:label_user_score_of_skill) %> :
|
<%= l(:label_user_score_of_skill) %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
<tr>
|
<tr>
|
||||||
<%= l(:label_user_score_of_active) %> :
|
<%= l(:label_user_score_of_active) %> :
|
||||||
<%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_f %>
|
<%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_i %>
|
||||||
</tr><br>
|
</tr><br>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,9 @@
|
||||||
</tr>
|
</tr>
|
||||||
<!-- <tr><div class="line_under"></div></tr> -->
|
<!-- <tr><div class="line_under"></div></tr> -->
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</table>
|
||||||
<% end %>
|
<% end %>
|
||||||
</table><% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" width="580" >
|
<td colspan="2" width="580" >
|
||||||
<p class="font_description">
|
<p class="font_description">
|
||||||
<%= membership.project.description%>
|
<%= membership.project.short_description%>
|
||||||
</p></td>
|
</p></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -114,12 +114,17 @@
|
||||||
<div class="main-content-bar" id="main-content-bar">
|
<div class="main-content-bar" id="main-content-bar">
|
||||||
<!--文字-->
|
<!--文字-->
|
||||||
<div style="float: left">
|
<div style="float: left">
|
||||||
<%= image_tag '/images/transparent.png', size: "75x75" %>
|
<% if get_avatar?(@contest_page) %>
|
||||||
|
<%= image_tag(url_to_avatar(@contest_page), size: "75x75") %>
|
||||||
|
<% else %>
|
||||||
|
<%= image_tag '/images/transparent.png', size: "75x75" %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="welcome_left" id="welcome_left">
|
<div class="welcome_left" id="welcome_left">
|
||||||
|
<% unless @contest_page.nil? %>
|
||||||
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %> <%= l(:label_welcome_trustie_contest) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_contest_description) %></span>
|
<span class="font_welcome_trustie"><%= @contest_page.title %></span> <span class="font_welcome_tdescription">, <%= @contest_page.description %></span>
|
||||||
</div>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!--搜索框-->
|
<!--搜索框-->
|
||||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||||
|
@ -145,7 +150,7 @@
|
||||||
<div class="d-p-projectlist">
|
<div class="d-p-projectlist">
|
||||||
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
|
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
|
||||||
|
|
||||||
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
|
<li style="overflow:auto;word-break:break-all;height:100%;" class='<%= cycle("odd", "even") %>'>
|
||||||
<div class="avatar-4" style="float: left; margin-top: 7px">
|
<div class="avatar-4" style="float: left; margin-top: 7px">
|
||||||
<%= image_tag('/images/contest1.png')%>
|
<%= image_tag('/images/contest1.png')%>
|
||||||
</div>
|
</div>
|
||||||
|
@ -160,8 +165,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;">
|
<div style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;">
|
||||||
<span class='font_lighter' title =<%=contest.description.to_s%>><%=contest.description.truncate(50, omission: '...')%></span>
|
<span class='font_lighter' title =<%=contest.description.to_s%>><%=contest.description.to_s%></span>
|
||||||
</div><br />
|
</div><br />
|
||||||
|
|
||||||
<div style="padding-left: 57px; clear: left;">
|
<div style="padding-left: 57px; clear: left;">
|
||||||
|
|
|
@ -51,14 +51,17 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %> </span>
|
<% end %> </span>
|
||||||
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> </span>
|
<% unless @course_page.nil? %>
|
||||||
|
<span class="font_welcome_trustie"><%= @course_page.title %> </span>
|
||||||
|
|
||||||
<% if @school_id.nil? and User.current.user_extensions.school.nil? %>
|
<% if @school_id.nil? and User.current.user_extensions.school.nil? %>
|
||||||
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
|
<span class="font_welcome_tdescription">, <%= @course_page.description %></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if @school_id == "0" %>
|
<% if @school_id == "0" %>
|
||||||
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
|
<span class="font_welcome_tdescription">, <%= @course_page.description %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-bar" id="search-bar">
|
<div class="search-bar" id="search-bar">
|
||||||
<%= render :partial => "search_course", :locals => {:project_type => Project::ProjectType_course} %>
|
<%= render :partial => "search_course", :locals => {:project_type => Project::ProjectType_course} %>
|
||||||
|
|
|
@ -30,13 +30,21 @@
|
||||||
<div id="identifier-pannel" style="display:none">
|
<div id="identifier-pannel" style="display:none">
|
||||||
<%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
|
<%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
|
||||||
<div class="weixin-content">微信扫码</div>
|
<div class="weixin-content">微信扫码</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="main-content-bar" id="main-content-bar">
|
<div class="main-content-bar" id="main-content-bar">
|
||||||
<div style="float: left">
|
<div style="float: left">
|
||||||
<%= image_tag '/images/transparent.png', size: "75x75" %>
|
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
|
||||||
|
<% if get_avatar?(@first_page) %>
|
||||||
|
<%= image_tag(url_to_avatar(@first_page), size: "75x75") %>
|
||||||
|
<% else %>
|
||||||
|
<%= image_tag '/images/transparent.png', size: "75x75" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="welcome_left" id="welcome_left">
|
<div class="welcome_left" id="welcome_left">
|
||||||
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_project) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_project_description) %></span>
|
<% unless @first_page.nil? %>
|
||||||
|
<span class="font_welcome_trustie"><%= @first_page.title %></span> <span class="font_welcome_tdescription">, <%= @first_page.description %></span>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-bar" id="search-bar">
|
<div class="search-bar" id="search-bar">
|
||||||
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
|
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
|
||||||
|
@ -52,9 +60,16 @@
|
||||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span>
|
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span>
|
||||||
<div class="d-p-projectlist-box">
|
<div class="d-p-projectlist-box">
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
|
<<<<<<< HEAD
|
||||||
<% projects = find_miracle_project(10, 3) %>
|
<% projects = find_miracle_project(10, 3) %>
|
||||||
<% projects.map do |project| %>
|
<% projects.map do |project| %>
|
||||||
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
|
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
|
||||||
|
=======
|
||||||
|
<% #projects = find_miracle_project(10, 3) %>
|
||||||
|
<% @projects.map do |project| %>
|
||||||
|
<!--<%# cache cache_key_for_project(project) do %> -->
|
||||||
|
<li style="overflow:auto;word-break:break-all;height:100%;" class='<%= cycle("odd", "even") %>'>
|
||||||
|
>>>>>>> remotes/origin/szzh
|
||||||
<div style="float: left;">
|
<div style="float: left;">
|
||||||
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -63,43 +78,47 @@
|
||||||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||||
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
|
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
|
||||||
</div>
|
</div>
|
||||||
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 10px; width: 380px;">
|
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;">
|
||||||
<span class='font_lighter' title =<%=project.description.to_s%>><%=project.description.truncate(50, omission: '...')%></span>
|
<span class='font_lighter' title =<%=project.description.to_s%>><%=project.description%></span>
|
||||||
</div>
|
</div>
|
||||||
<div style="position:absolute; bottom:0;right:0;margin:5px 10px 5px 5px ;">
|
<div >
|
||||||
<% issue_count = project.issues.count %>
|
<%# issue_count = project.issues.count %>
|
||||||
<% issue_journal_count = project.issue_changes.count %>
|
<%# issue_journal_count = project.issue_changes.count %>
|
||||||
<% issue_score = issue_count * 0.2 %>
|
<%# issue_score = issue_count * 0.2 %>
|
||||||
<% issue_journal_score = issue_journal_count * 0.1 %>
|
<%# issue_journal_score = issue_journal_count * 0.1 %>
|
||||||
<% finall_issue_score = issue_score + issue_journal_score %>
|
<%# finall_issue_score = issue_score + issue_journal_score %>
|
||||||
|
|
||||||
<% new_count = project.news.count %>
|
<%# new_count = project.news.count %>
|
||||||
<% new_score = new_count * 0.1 %>
|
<%# new_score = new_count * 0.1 %>
|
||||||
<% finall_new_score = new_score %>
|
<%# finall_new_score = new_score %>
|
||||||
|
|
||||||
<% document_count = project.documents.count %>
|
<%# document_count = project.documents.count %>
|
||||||
<% file_score = document_count * 0.1 %>
|
<%# file_score = document_count * 0.1 %>
|
||||||
<% finall_file_score = file_score %>
|
<%# finall_file_score = file_score %>
|
||||||
|
|
||||||
<% changeset_count = project.changesets.count %>
|
<%# changeset_count = project.changesets.count %>
|
||||||
<% code_submit_score = changeset_count * 0.3 %>
|
<%# code_submit_score = changeset_count * 0.3 %>
|
||||||
<% finall_code_submit_score = code_submit_score %>
|
<%# finall_code_submit_score = code_submit_score %>
|
||||||
|
|
||||||
<% board_message_count = 0 %>
|
<%# board_message_count = 0 %>
|
||||||
<% project.boards.each do |board| %>
|
<%# project.boards.each do |board| %>
|
||||||
<% board_message_count += board.messages_count %>
|
<%# board_message_count += board.messages_count %>
|
||||||
<% end %>
|
<%# end %>
|
||||||
<% topic_score = board_message_count * 0.1 %>
|
<%# topic_score = board_message_count * 0.1 %>
|
||||||
<% finall_topic_score = topic_score %>
|
<%# finall_topic_score = topic_score %>
|
||||||
|
|
||||||
<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
|
<%# finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
|
||||||
<%= content_tag "span", l(:label_project_score)+ ":" + format("%.2f" , finall_project_score ),
|
<%= content_tag "span", l(:label_project_score)+ ":" + project_score(project),
|
||||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ",
|
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
|
||||||
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
||||||
:class => "tooltip",
|
:class => "tooltip",
|
||||||
:id => "tooltip-#{project.id}" %>
|
:id => "tooltip-#{project.id}" %>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
<!--<%#end %> -->
|
||||||
|
>>>>>>> remotes/origin/szzh
|
||||||
<% end; reset_cycle %>
|
<% end; reset_cycle %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -112,6 +131,10 @@
|
||||||
<div class="user-message-box-list" style="margin-top: 10px;">
|
<div class="user-message-box-list" style="margin-top: 10px;">
|
||||||
<%activities = find_all_activities%>
|
<%activities = find_all_activities%>
|
||||||
<% activities.each do |event| %>
|
<% activities.each do |event| %>
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
<!--<%# cache cache_key_for_event(event) do %> -->
|
||||||
|
>>>>>>> remotes/origin/szzh
|
||||||
<li style="display: block;height:60px; padding-bottom: 4px;">
|
<li style="display: block;height:60px; padding-bottom: 4px;">
|
||||||
<div class="inner-right" style="float: left; height: 100%; ">
|
<div class="inner-right" style="float: left; height: 100%; ">
|
||||||
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
||||||
|
@ -122,6 +145,10 @@
|
||||||
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
<!--<%#end %> --><!-- cache -->
|
||||||
|
>>>>>>> remotes/origin/szzh
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -199,6 +199,7 @@ default:
|
||||||
|
|
||||||
# Maximum number of simultaneous AJAX uploads
|
# Maximum number of simultaneous AJAX uploads
|
||||||
#max_concurrent_ajax_uploads: 2
|
#max_concurrent_ajax_uploads: 2
|
||||||
|
#pic_types: "bmp,jpeg,jpg,png,gif"
|
||||||
|
|
||||||
# specific configuration options for production environment
|
# specific configuration options for production environment
|
||||||
# that overrides the default ones
|
# that overrides the default ones
|
||||||
|
|
|
@ -537,6 +537,7 @@ en:
|
||||||
label_document_new: New document
|
label_document_new: New document
|
||||||
label_document_plural: Documents
|
label_document_plural: Documents
|
||||||
label_document_added: Document added
|
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: Role
|
||||||
label_role_plural: Roles
|
label_role_plural: Roles
|
||||||
label_role_new: New role
|
label_role_new: New role
|
||||||
|
@ -936,6 +937,7 @@ en:
|
||||||
label_cross_project_hierarchy: With project hierarchy
|
label_cross_project_hierarchy: With project hierarchy
|
||||||
label_cross_project_system: With all projects
|
label_cross_project_system: With all projects
|
||||||
label_gantt_progress_line: Progress line
|
label_gantt_progress_line: Progress line
|
||||||
|
label_files_filter: Files Filter:
|
||||||
|
|
||||||
button_login: Login
|
button_login: Login
|
||||||
button_submit: Submit
|
button_submit: Submit
|
||||||
|
|
|
@ -266,6 +266,7 @@ zh:
|
||||||
field_value: 值
|
field_value: 值
|
||||||
field_category: 类别
|
field_category: 类别
|
||||||
field_title: 标题
|
field_title: 标题
|
||||||
|
field_web_title: 浏览器标题
|
||||||
field_project: 项目
|
field_project: 项目
|
||||||
field_issue: 问题
|
field_issue: 问题
|
||||||
field_status: 状态
|
field_status: 状态
|
||||||
|
@ -516,6 +517,10 @@ zh:
|
||||||
label_project_new_description: '项目可以是软件开发项目,也可以是协作研究项目。'
|
label_project_new_description: '项目可以是软件开发项目,也可以是协作研究项目。'
|
||||||
label_project_plural: 项目列表
|
label_project_plural: 项目列表
|
||||||
label_project_score: 项目评分
|
label_project_score: 项目评分
|
||||||
|
label_first_page_made: 首页定制
|
||||||
|
label_project_first_page: 项目托管平台首页
|
||||||
|
label_course_first_page: 课程实践平台首页
|
||||||
|
label_contest_first_page: 竞赛实战平台首页
|
||||||
label_x_projects:
|
label_x_projects:
|
||||||
zero: 无项目
|
zero: 无项目
|
||||||
one: 1 个项目
|
one: 1 个项目
|
||||||
|
@ -533,6 +538,7 @@ zh:
|
||||||
label_document_new: 新建文档
|
label_document_new: 新建文档
|
||||||
label_document_plural: 文档
|
label_document_plural: 文档
|
||||||
label_document_added: 文档已添加
|
label_document_added: 文档已添加
|
||||||
|
label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。)
|
||||||
label_role: 角色
|
label_role: 角色
|
||||||
label_role_plural: 角色
|
label_role_plural: 角色
|
||||||
label_role_new: 新建角色
|
label_role_new: 新建角色
|
||||||
|
@ -562,6 +568,11 @@ zh:
|
||||||
label_login_with_open_id_option: 或使用OpenID登录
|
label_login_with_open_id_option: 或使用OpenID登录
|
||||||
label_password_lost: 忘记密码
|
label_password_lost: 忘记密码
|
||||||
label_home: 主页
|
label_home: 主页
|
||||||
|
label_web_title: 浏览器标题
|
||||||
|
label_site_title: 网站标题
|
||||||
|
label_site_description: 网站简介
|
||||||
|
label_site_image: 简介图片
|
||||||
|
label_sort_type: 热门项目排序方式
|
||||||
#by young
|
#by young
|
||||||
label_requirement: 需求
|
label_requirement: 需求
|
||||||
label_new_course: 课程列表
|
label_new_course: 课程列表
|
||||||
|
@ -1219,6 +1230,7 @@ zh:
|
||||||
button_export: 导出
|
button_export: 导出
|
||||||
label_export_options: "%{export_format} 导出选项"
|
label_export_options: "%{export_format} 导出选项"
|
||||||
error_attachment_too_big: 该文件无法上传。超过文件大小限制 (%{max_size})
|
error_attachment_too_big: 该文件无法上传。超过文件大小限制 (%{max_size})
|
||||||
|
error_pic_type: "仅支持如下图片格式:"
|
||||||
notice_failed_to_save_time_entries: "无法保存下列所选取的 %{total} 个项目中的 %{count} 工时: %{ids}。"
|
notice_failed_to_save_time_entries: "无法保存下列所选取的 %{total} 个项目中的 %{count} 工时: %{ids}。"
|
||||||
label_x_issues:
|
label_x_issues:
|
||||||
zero: 0 问题
|
zero: 0 问题
|
||||||
|
@ -1474,6 +1486,7 @@ zh:
|
||||||
label_contest_description: 内容:对你的竞赛进行描述
|
label_contest_description: 内容:对你的竞赛进行描述
|
||||||
label_requirement_bargain_money: 输入具体奖励方式(如金钱、奖项、学分)
|
label_requirement_bargain_money: 输入具体奖励方式(如金钱、奖项、学分)
|
||||||
button_upload_photo: 上传图片
|
button_upload_photo: 上传图片
|
||||||
|
button_delete_file: 删除
|
||||||
label_leave_me_message: 给我留言了
|
label_leave_me_message: 给我留言了
|
||||||
label_leave_others_message: 给他留言了
|
label_leave_others_message: 给他留言了
|
||||||
label_leave_a_message: 给他(她)留言
|
label_leave_a_message: 给他(她)留言
|
||||||
|
@ -1729,6 +1742,7 @@ zh:
|
||||||
label_file_number: 文档的数量
|
label_file_number: 文档的数量
|
||||||
label_code_submit_number: 代码提交数量
|
label_code_submit_number: 代码提交数量
|
||||||
label_topic_number: 讨论区帖子数量
|
label_topic_number: 讨论区帖子数量
|
||||||
|
label_files_filter: 资源过滤:
|
||||||
|
|
||||||
label_course_contribute_to: 参与了 %{project_count} 个项目:
|
label_course_contribute_to: 参与了 %{project_count} 个项目:
|
||||||
label_x_course_contribute_to:
|
label_x_course_contribute_to:
|
||||||
|
@ -1891,6 +1905,7 @@ zh:
|
||||||
field_teacher_name: 教 师
|
field_teacher_name: 教 师
|
||||||
|
|
||||||
field_hidden_repo: 隐藏代码库
|
field_hidden_repo: 隐藏代码库
|
||||||
|
field_dts_test: DTS测试工具
|
||||||
|
|
||||||
label_newbie_faq: '新手指引 & 问答'
|
label_newbie_faq: '新手指引 & 问答'
|
||||||
label_hot_project: '热门项目'
|
label_hot_project: '热门项目'
|
||||||
|
@ -1900,6 +1915,7 @@ zh:
|
||||||
label_memo_create_fail: 发布失败
|
label_memo_create_fail: 发布失败
|
||||||
label_forum_create_succ: 贴吧新建成功
|
label_forum_create_succ: 贴吧新建成功
|
||||||
label_forum_create_fail: 贴吧新建失败
|
label_forum_create_fail: 贴吧新建失败
|
||||||
|
label_first_page_create_fail: 首页定制失败
|
||||||
label_forum_edit: 编辑讨论区
|
label_forum_edit: 编辑讨论区
|
||||||
label_memo_create: 发布
|
label_memo_create: 发布
|
||||||
label_memo_new: 新建主题
|
label_memo_new: 新建主题
|
||||||
|
|
|
@ -559,6 +559,9 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'admin', :controller => 'admin', :action => 'index', :via => :get
|
match 'admin', :controller => 'admin', :action => 'index', :via => :get
|
||||||
match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
|
match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
|
||||||
match 'admin/users', :controller => 'admin', :action => 'users', :via => :get
|
match 'admin/users', :controller => 'admin', :action => 'users', :via => :get
|
||||||
|
match 'admin/first_page_made',:controller => 'admin',:action => 'first_page_made',:via => [:get,:post]
|
||||||
|
match 'admin/course_page_made',:controller => 'admin',:action => 'course_page_made',:via => [:get,:post]
|
||||||
|
match 'admin/contest_page_made',:controller => 'admin',:action => 'contest_page_made',:via => [:get,:post]
|
||||||
match 'admin/search', :controller => 'admin', :action => 'search', :via => [:get, :post]
|
match 'admin/search', :controller => 'admin', :action => 'search', :via => [:get, :post]
|
||||||
match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
|
match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
|
||||||
match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
|
match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
|
||||||
|
@ -574,7 +577,6 @@ RedmineApp::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
match 'projects/course', :to => 'courses#course', :as => 'courses_course'
|
|
||||||
match 'courses/search', :to => 'courses#search'
|
match 'courses/search', :to => 'courses#search'
|
||||||
# add by nwb
|
# add by nwb
|
||||||
# 课程路由设置
|
# 课程路由设置
|
||||||
|
@ -626,6 +628,7 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'uploads', :to => 'attachments#upload', :via => :post
|
match 'uploads', :to => 'attachments#upload', :via => :post
|
||||||
# Added by Tao
|
# Added by Tao
|
||||||
match 'upload_avatar', :to => 'avatar#upload', :via => :post
|
match 'upload_avatar', :to => 'avatar#upload', :via => :post
|
||||||
|
match 'delete_avatar', :to => 'avatar#delete_image',:via => :post
|
||||||
# Endof Tao's code
|
# Endof Tao's code
|
||||||
get 'robots.txt', :to => 'welcome#robots'
|
get 'robots.txt', :to => 'welcome#robots'
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# -*coding:utf-8 -*-
|
||||||
|
class CreateFirstPages < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :first_pages do |t|
|
||||||
|
t.string :web_title
|
||||||
|
t.string :title
|
||||||
|
t.string :description
|
||||||
|
t.string :page_type
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
fp = FirstPage.new
|
||||||
|
fp.web_title = "Trustie - 为大学生技术创新筑巢"
|
||||||
|
fp.title = "Trustie在线项目托管平台"
|
||||||
|
fp.description = "面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。"
|
||||||
|
fp.page_type = "project"
|
||||||
|
|
||||||
|
fp.save
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,9 @@
|
||||||
|
class AddCloumnToFirstPage < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
#add_column :first_pages,:type,:string
|
||||||
|
|
||||||
|
#fr = FirstPage.all.first
|
||||||
|
#fr.type = "project"
|
||||||
|
#fr.save
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AltColumnName < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
#rename_column :first_pages,:type,:page_type
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,17 @@
|
||||||
|
# -*coding:utf-8 -*-
|
||||||
|
class AddContestAndCourseFirstPage < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
fp = FirstPage.new
|
||||||
|
fp.web_title = ""
|
||||||
|
fp.title = "Trustie在线课程实践平台"
|
||||||
|
fp.description = "面向中国高校教师与大学生,提供社交化的课程管理、资源共享、合作实验、协同研究。"
|
||||||
|
fp.page_type = "course"
|
||||||
|
fp.save
|
||||||
|
fp1 = FirstPage.new
|
||||||
|
fp1.web_title = ""
|
||||||
|
fp1.title = "Trustie在线竞赛实战平台"
|
||||||
|
fp1.description = "面向中国大学生与编程爱好者,提供社交化的竞赛管理、应用管理、代码托管、合作交流。"
|
||||||
|
fp1.page_type = "contest"
|
||||||
|
fp1.save
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddIsPublicToDocuments < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :documents, :is_public, :integer,:default => 1
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,9 @@
|
||||||
|
# -*coding:utf-8 -*-
|
||||||
|
class SetWebTitle < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
FirstPage.all.each do |fp|
|
||||||
|
fp.web_title = "Trustie - 为大学生技术创新筑巢"
|
||||||
|
fp.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -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
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddColumnForFirstPage < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column("first_pages","sort_type",:integer)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,8 @@
|
||||||
|
class SetSortType < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
FirstPage.all.each do |fp|
|
||||||
|
fp.sort_type = 1
|
||||||
|
fp.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
33
db/schema.rb
33
db/schema.rb
|
@ -11,11 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
<<<<<<< HEAD
|
ActiveRecord::Schema.define(:version => 20140716021558) do
|
||||||
ActiveRecord::Schema.define(:version => 20140710030426) do
|
|
||||||
=======
|
|
||||||
ActiveRecord::Schema.define(:version => 20140708023356) do
|
|
||||||
>>>>>>> 056f86caad29ca95632d9da9e1e616cd00e2349a
|
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -383,6 +379,7 @@ ActiveRecord::Schema.define(:version => 20140708023356) do
|
||||||
t.text "description"
|
t.text "description"
|
||||||
t.datetime "created_on"
|
t.datetime "created_on"
|
||||||
t.integer "user_id", :default => 0
|
t.integer "user_id", :default => 0
|
||||||
|
t.integer "is_public", :default => 1
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "documents", ["category_id"], :name => "index_documents_on_category_id"
|
add_index "documents", ["category_id"], :name => "index_documents_on_category_id"
|
||||||
|
@ -411,6 +408,16 @@ ActiveRecord::Schema.define(:version => 20140708023356) do
|
||||||
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
|
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
|
||||||
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
|
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"
|
||||||
|
t.integer "sort_type"
|
||||||
|
end
|
||||||
|
|
||||||
create_table "forums", :force => true do |t|
|
create_table "forums", :force => true do |t|
|
||||||
t.string "name", :null => false
|
t.string "name", :null => false
|
||||||
t.string "description", :default => ""
|
t.string "description", :default => ""
|
||||||
|
@ -763,6 +770,7 @@ ActiveRecord::Schema.define(:version => 20140708023356) do
|
||||||
t.boolean "hidden_repo", :default => false, :null => false
|
t.boolean "hidden_repo", :default => false, :null => false
|
||||||
t.integer "attachmenttype", :default => 1
|
t.integer "attachmenttype", :default => 1
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
|
t.integer "dts_test", :default => 0
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
||||||
|
@ -799,7 +807,7 @@ ActiveRecord::Schema.define(:version => 20140708023356) do
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "relative_memos", :force => true do |t|
|
create_table "relative_memos", :force => true do |t|
|
||||||
t.integer "osp_id", :null => false
|
t.integer "osp_id"
|
||||||
t.integer "parent_id"
|
t.integer "parent_id"
|
||||||
t.string "subject", :null => false
|
t.string "subject", :null => false
|
||||||
t.text "content", :null => false
|
t.text "content", :null => false
|
||||||
|
@ -836,19 +844,6 @@ ActiveRecord::Schema.define(:version => 20140708023356) do
|
||||||
|
|
||||||
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
|
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|
|
create_table "roles", :force => true do |t|
|
||||||
t.string "name", :limit => 30, :default => "", :null => false
|
t.string "name", :limit => 30, :default => "", :null => false
|
||||||
t.integer "position", :default => 1
|
t.integer "position", :default => 1
|
||||||
|
|
Binary file not shown.
|
@ -29,7 +29,7 @@ module Redmine
|
||||||
send :include, Redmine::Acts::ActivityProvider::InstanceMethods
|
send :include, Redmine::Acts::ActivityProvider::InstanceMethods
|
||||||
end
|
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 ||= {}
|
self.activity_provider_options ||= {}
|
||||||
|
|
||||||
# One model can provide different event types
|
# One model can provide different event types
|
||||||
|
@ -65,6 +65,11 @@ module Redmine
|
||||||
scope = scope.scoped(:conditions => ["#{provider_options[:author_key]} = ?", options[:author].id])
|
scope = scope.scoped(:conditions => ["#{provider_options[:author_key]} = ?", options[:author].id])
|
||||||
end
|
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]
|
if options[:limit]
|
||||||
# id and creation time should be in same order in most cases
|
# id and creation time should be in same order in most cases
|
||||||
scope = scope.scoped(:order => "#{table_name}.id DESC", :limit => options[:limit])
|
scope = scope.scoped(:order => "#{table_name}.id DESC", :limit => options[:limit])
|
||||||
|
|
|
@ -8,7 +8,7 @@ gem 'actionpack'
|
||||||
require 'action_controller'
|
require 'action_controller'
|
||||||
|
|
||||||
gem 'mocha'
|
gem 'mocha'
|
||||||
require 'mocha'
|
require 'mocha/setup'
|
||||||
|
|
||||||
gem 'ruby-openid'
|
gem 'ruby-openid'
|
||||||
require 'openid'
|
require 'openid'
|
||||||
|
|
|
@ -351,6 +351,7 @@ end
|
||||||
Redmine::MenuManager.map :admin_menu do |menu|
|
Redmine::MenuManager.map :admin_menu do |menu|
|
||||||
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
|
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
|
||||||
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
|
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
|
||||||
|
menu.push :first_page_made, {:controller => 'admin',:action => 'first_page_made'},:caption => :label_first_page_made
|
||||||
menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural
|
menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural
|
||||||
menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions
|
menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions
|
||||||
menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural
|
menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural
|
||||||
|
|
|
@ -82,6 +82,8 @@ module Redmine
|
||||||
def events(from = nil, to = nil, options={})
|
def events(from = nil, to = nil, options={})
|
||||||
e = []
|
e = []
|
||||||
@options[:limit] = options[:limit]
|
@options[:limit] = options[:limit]
|
||||||
|
# modify by nwb
|
||||||
|
@options[:is_public] = options[:is_public]
|
||||||
|
|
||||||
@scope.each do |event_type|
|
@scope.each do |event_type|
|
||||||
constantized_providers(event_type).each do |provider|
|
constantized_providers(event_type).each do |provider|
|
||||||
|
|
|
@ -21,7 +21,8 @@ module Redmine
|
||||||
# Configuration default values
|
# Configuration default values
|
||||||
@defaults = {
|
@defaults = {
|
||||||
'email_delivery' => nil,
|
'email_delivery' => nil,
|
||||||
'max_concurrent_ajax_uploads' => 2
|
'max_concurrent_ajax_uploads' => 2,
|
||||||
|
'pic_types' => "bmp,jpeg,jpg,png,gif"
|
||||||
}
|
}
|
||||||
|
|
||||||
@config = nil
|
@config = nil
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,45 @@
|
||||||
/*
|
/*
|
||||||
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
*/
|
*/
|
||||||
CKEDITOR.dialog.add("a11yHelp",function(j){var a=j.lang.a11yhelp,l=CKEDITOR.tools.getNextId(),e={8:a.backspace,9:a.tab,13:a.enter,16:a.shift,17:a.ctrl,18:a.alt,19:a.pause,20:a.capslock,27:a.escape,33:a.pageUp,34:a.pageDown,35:a.end,36:a.home,37:a.leftArrow,38:a.upArrow,39:a.rightArrow,40:a.downArrow,45:a.insert,46:a["delete"],91:a.leftWindowKey,92:a.rightWindowKey,93:a.selectKey,96:a.numpad0,97:a.numpad1,98:a.numpad2,99:a.numpad3,100:a.numpad4,101:a.numpad5,102:a.numpad6,103:a.numpad7,104:a.numpad8,
|
CKEDITOR.dialog.add("a11yHelp", function (j) {
|
||||||
105:a.numpad9,106:a.multiply,107:a.add,109:a.subtract,110:a.decimalPoint,111:a.divide,112:a.f1,113:a.f2,114:a.f3,115:a.f4,116:a.f5,117:a.f6,118:a.f7,119:a.f8,120:a.f9,121:a.f10,122:a.f11,123:a.f12,144:a.numLock,145:a.scrollLock,186:a.semiColon,187:a.equalSign,188:a.comma,189:a.dash,190:a.period,191:a.forwardSlash,192:a.graveAccent,219:a.openBracket,220:a.backSlash,221:a.closeBracket,222:a.singleQuote};e[CKEDITOR.ALT]=a.alt;e[CKEDITOR.SHIFT]=a.shift;e[CKEDITOR.CTRL]=a.ctrl;var f=[CKEDITOR.ALT,CKEDITOR.SHIFT,
|
var a = j.lang.a11yhelp, l = CKEDITOR.tools.getNextId(), e = {8: a.backspace, 9: a.tab, 13: a.enter, 16: a.shift, 17: a.ctrl, 18: a.alt, 19: a.pause, 20: a.capslock, 27: a.escape, 33: a.pageUp, 34: a.pageDown, 35: a.end, 36: a.home, 37: a.leftArrow, 38: a.upArrow, 39: a.rightArrow, 40: a.downArrow, 45: a.insert, 46: a["delete"], 91: a.leftWindowKey, 92: a.rightWindowKey, 93: a.selectKey, 96: a.numpad0, 97: a.numpad1, 98: a.numpad2, 99: a.numpad3, 100: a.numpad4, 101: a.numpad5, 102: a.numpad6, 103: a.numpad7, 104: a.numpad8,
|
||||||
CKEDITOR.CTRL],m=/\$\{(.*?)\}/g,p=function(){var a=j.keystrokeHandler.keystrokes,g={},c;for(c in a)g[a[c]]=c;return function(a,c){var b;if(g[c]){b=g[c];for(var h,i,k=[],d=0;d<f.length;d++)i=f[d],h=b/f[d],1<h&&2>=h&&(b-=i,k.push(e[i]));k.push(e[b]||String.fromCharCode(b));b=k.join("+")}else b=a;return b}}();return{title:a.title,minWidth:600,minHeight:400,contents:[{id:"info",label:j.lang.common.generalTab,expand:!0,elements:[{type:"html",id:"legends",style:"white-space:normal;",focus:function(){this.getElement().focus()},
|
105: a.numpad9, 106: a.multiply, 107: a.add, 109: a.subtract, 110: a.decimalPoint, 111: a.divide, 112: a.f1, 113: a.f2, 114: a.f3, 115: a.f4, 116: a.f5, 117: a.f6, 118: a.f7, 119: a.f8, 120: a.f9, 121: a.f10, 122: a.f11, 123: a.f12, 144: a.numLock, 145: a.scrollLock, 186: a.semiColon, 187: a.equalSign, 188: a.comma, 189: a.dash, 190: a.period, 191: a.forwardSlash, 192: a.graveAccent, 219: a.openBracket, 220: a.backSlash, 221: a.closeBracket, 222: a.singleQuote};
|
||||||
html:function(){for(var e='<div class="cke_accessibility_legend" role="document" aria-labelledby="'+l+'_arialbl" tabIndex="-1">%1</div><span id="'+l+'_arialbl" class="cke_voice_label">'+a.contents+" </span>",g=[],c=a.legend,j=c.length,f=0;f<j;f++){for(var b=c[f],h=[],i=b.items,k=i.length,d=0;d<k;d++){var n=i[d],o=n.legend.replace(m,p);o.match(m)||h.push("<dt>%1</dt><dd>%2</dd>".replace("%1",n.name).replace("%2",o))}g.push("<h1>%1</h1><dl>%2</dl>".replace("%1",b.name).replace("%2",h.join("")))}return e.replace("%1",
|
e[CKEDITOR.ALT] = a.alt;
|
||||||
g.join(""))}()+'<style type="text/css">.cke_accessibility_legend{width:600px;height:400px;padding-right:5px;overflow-y:auto;overflow-x:hidden;}.cke_browser_quirks .cke_accessibility_legend,.cke_browser_ie6 .cke_accessibility_legend{height:390px}.cke_accessibility_legend *{white-space:normal;}.cke_accessibility_legend h1{font-size: 20px;border-bottom: 1px solid #AAA;margin: 5px 0px 15px;}.cke_accessibility_legend dl{margin-left: 5px;}.cke_accessibility_legend dt{font-size: 13px;font-weight: bold;}.cke_accessibility_legend dd{margin:10px}</style>'}]}],
|
e[CKEDITOR.SHIFT] = a.shift;
|
||||||
buttons:[CKEDITOR.dialog.cancelButton]}});
|
e[CKEDITOR.CTRL] = a.ctrl;
|
||||||
|
var f = [CKEDITOR.ALT, CKEDITOR.SHIFT,
|
||||||
|
CKEDITOR.CTRL], m = /\$\{(.*?)\}/g, p = function () {
|
||||||
|
var a = j.keystrokeHandler.keystrokes, g = {}, c;
|
||||||
|
for (c in a)g[a[c]] = c;
|
||||||
|
return function (a, c) {
|
||||||
|
var b;
|
||||||
|
if (g[c]) {
|
||||||
|
b = g[c];
|
||||||
|
for (var h, i, k = [], d = 0; d < f.length; d++)i = f[d], h = b / f[d], 1 < h && 2 >= h && (b -= i, k.push(e[i]));
|
||||||
|
k.push(e[b] || String.fromCharCode(b));
|
||||||
|
b = k.join("+")
|
||||||
|
} else b = a;
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
return{title: a.title, minWidth: 600, minHeight: 400, contents: [
|
||||||
|
{id: "info", label: j.lang.common.generalTab, expand: !0, elements: [
|
||||||
|
{type: "html", id: "legends", style: "white-space:normal;", focus: function () {
|
||||||
|
this.getElement().focus()
|
||||||
|
},
|
||||||
|
html: function () {
|
||||||
|
for (var e = '<div class="cke_accessibility_legend" role="document" aria-labelledby="' + l + '_arialbl" tabIndex="-1">%1</div><span id="' + l + '_arialbl" class="cke_voice_label">' + a.contents + " </span>", g = [], c = a.legend, j = c.length, f = 0; f < j; f++) {
|
||||||
|
for (var b = c[f], h = [], i = b.items, k = i.length, d = 0; d < k; d++) {
|
||||||
|
var n = i[d], o = n.legend.replace(m, p);
|
||||||
|
o.match(m) || h.push("<dt>%1</dt><dd>%2</dd>".replace("%1", n.name).replace("%2", o))
|
||||||
|
}
|
||||||
|
g.push("<h1>%1</h1><dl>%2</dl>".replace("%1", b.name).replace("%2", h.join("")))
|
||||||
|
}
|
||||||
|
return e.replace("%1",
|
||||||
|
g.join(""))
|
||||||
|
}() + '<style type="text/css">.cke_accessibility_legend{width:600px;height:400px;padding-right:5px;overflow-y:auto;overflow-x:hidden;}.cke_browser_quirks .cke_accessibility_legend,.cke_browser_ie6 .cke_accessibility_legend{height:390px}.cke_accessibility_legend *{white-space:normal;}.cke_accessibility_legend h1{font-size: 20px;border-bottom: 1px solid #AAA;margin: 5px 0px 15px;}.cke_accessibility_legend dl{margin-left: 5px;}.cke_accessibility_legend dt{font-size: 13px;font-weight: bold;}.cke_accessibility_legend dd{margin:10px}</style>'}
|
||||||
|
]}
|
||||||
|
],
|
||||||
|
buttons: [CKEDITOR.dialog.cancelButton]}
|
||||||
|
});
|
|
@ -1,11 +1,30 @@
|
||||||
/*
|
|
||||||
|
|
||||||
|
/*
|
||||||
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
*/
|
*/
|
||||||
CKEDITOR.plugins.setLang("a11yhelp","ar",{title:"Accessibility Instructions",contents:"Help Contents. To close this dialog press ESC.",legend:[{name:"عام",items:[{name:"Editor Toolbar",legend:"Press ${toolbarFocus} to navigate to the toolbar. Move to the next and previous toolbar group with TAB and SHIFT-TAB. Move to the next and previous toolbar button with RIGHT ARROW or LEFT ARROW. Press SPACE or ENTER to activate the toolbar button."},{name:"Editor Dialog",legend:"Inside a dialog, press TAB to navigate to next dialog field, press SHIFT + TAB to move to previous field, press ENTER to submit dialog, press ESC to cancel dialog. For dialogs that have multiple tab pages, press ALT + F10 to navigate to tab-list. Then move to next tab with TAB OR RIGTH ARROW. Move to previous tab with SHIFT + TAB or LEFT ARROW. Press SPACE or ENTER to select the tab page."},
|
CKEDITOR.plugins.setLang("a11yhelp", "ar", {title: "Accessibility Instructions", contents: "Help Contents. To close this dialog press ESC.", legend: [
|
||||||
{name:"Editor Context Menu",legend:"Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC."},{name:"Editor List Box",legend:"Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT + TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box."},
|
{name: "عام", items: [
|
||||||
{name:"Editor Element Path Bar",legend:"Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor."}]},{name:"Commands",items:[{name:" Undo command",legend:"Press ${undo}"},{name:" Redo command",legend:"Press ${redo}"},{name:" Bold command",legend:"Press ${bold}"},{name:" Italic command",legend:"Press ${italic}"},{name:" Underline command",
|
{name: "Editor Toolbar", legend: "Press ${toolbarFocus} to navigate to the toolbar. Move to the next and previous toolbar group with TAB and SHIFT-TAB. Move to the next and previous toolbar button with RIGHT ARROW or LEFT ARROW. Press SPACE or ENTER to activate the toolbar button."},
|
||||||
legend:"Press ${underline}"},{name:" Link command",legend:"Press ${link}"},{name:" Toolbar Collapse command",legend:"Press ${toolbarCollapse}"},{name:" Access previous focus space command",legend:"Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},{name:" Access next focus space command",legend:"Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},
|
{name: "Editor Dialog", legend: "Inside a dialog, press TAB to navigate to next dialog field, press SHIFT + TAB to move to previous field, press ENTER to submit dialog, press ESC to cancel dialog. For dialogs that have multiple tab pages, press ALT + F10 to navigate to tab-list. Then move to next tab with TAB OR RIGTH ARROW. Move to previous tab with SHIFT + TAB or LEFT ARROW. Press SPACE or ENTER to select the tab page."},
|
||||||
{name:" Accessibility Help",legend:"Press ${a11yHelp}"}]}],backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"Left Arrow",upArrow:"Up Arrow",rightArrow:"Right Arrow",downArrow:"Down Arrow",insert:"Insert","delete":"Delete",leftWindowKey:"Left Windows key",rightWindowKey:"Right Windows key",selectKey:"Select key",numpad0:"Numpad 0",numpad1:"Numpad 1",
|
{name: "Editor Context Menu", legend: "Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC."},
|
||||||
numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4",numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Multiply",add:"Add",subtract:"Subtract",decimalPoint:"Decimal Point",divide:"Divide",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Semicolon",equalSign:"Equal Sign",comma:"Comma",dash:"Dash",period:"Period",forwardSlash:"Forward Slash",
|
{name: "Editor List Box", legend: "Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT + TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box."},
|
||||||
graveAccent:"Grave Accent",openBracket:"Open Bracket",backSlash:"Backslash",closeBracket:"Close Bracket",singleQuote:"Single Quote"});
|
{name: "Editor Element Path Bar", legend: "Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor."}
|
||||||
|
]},
|
||||||
|
{name: "Commands", items: [
|
||||||
|
{name: " Undo command", legend: "Press ${undo}"},
|
||||||
|
{name: " Redo command", legend: "Press ${redo}"},
|
||||||
|
{name: " Bold command", legend: "Press ${bold}"},
|
||||||
|
{name: " Italic command", legend: "Press ${italic}"},
|
||||||
|
{name: " Underline command",
|
||||||
|
legend: "Press ${underline}"},
|
||||||
|
{name: " Link command", legend: "Press ${link}"},
|
||||||
|
{name: " Toolbar Collapse command", legend: "Press ${toolbarCollapse}"},
|
||||||
|
{name: " Access previous focus space command", legend: "Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},
|
||||||
|
{name: " Access next focus space command", legend: "Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},
|
||||||
|
{name: " Accessibility Help", legend: "Press ${a11yHelp}"}
|
||||||
|
]}
|
||||||
|
], backspace: "Backspace", tab: "Tab", enter: "Enter", shift: "Shift", ctrl: "Ctrl", alt: "Alt", pause: "Pause", capslock: "Caps Lock", escape: "Escape", pageUp: "Page Up", pageDown: "Page Down", end: "End", home: "Home", leftArrow: "Left Arrow", upArrow: "Up Arrow", rightArrow: "Right Arrow", downArrow: "Down Arrow", insert: "Insert", "delete": "Delete", leftWindowKey: "Left Windows key", rightWindowKey: "Right Windows key", selectKey: "Select key", numpad0: "Numpad 0", numpad1: "Numpad 1",
|
||||||
|
numpad2: "Numpad 2", numpad3: "Numpad 3", numpad4: "Numpad 4", numpad5: "Numpad 5", numpad6: "Numpad 6", numpad7: "Numpad 7", numpad8: "Numpad 8", numpad9: "Numpad 9", multiply: "Multiply", add: "Add", subtract: "Subtract", decimalPoint: "Decimal Point", divide: "Divide", f1: "F1", f2: "F2", f3: "F3", f4: "F4", f5: "F5", f6: "F6", f7: "F7", f8: "F8", f9: "F9", f10: "F10", f11: "F11", f12: "F12", numLock: "Num Lock", scrollLock: "Scroll Lock", semiColon: "Semicolon", equalSign: "Equal Sign", comma: "Comma", dash: "Dash", period: "Period", forwardSlash: "Forward Slash",
|
||||||
|
graveAccent: "Grave Accent", openBracket: "Open Bracket", backSlash: "Backslash", closeBracket: "Close Bracket", singleQuote: "Single Quote"});
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue