Merge branch 'master' into 90-pull
Conflicts: Gemfile Gemfile.lock app/controllers/projects/issues_controller.rb app/models/project.rb config/locales/menu.en.yml config/routes.rb db/schema.rb
This commit is contained in:
commit
36b4ce2d99
20
Gemfile
20
Gemfile
|
@ -1,6 +1,6 @@
|
||||||
source 'http://rubygems.org'
|
source 'http://rubygems.org'
|
||||||
|
|
||||||
gem 'rails', '3.2.2' #, :git => 'git://github.com/rails/rails.git'
|
gem 'rails', '3.2.3' #, :git => 'git://github.com/rails/rails.git'
|
||||||
|
|
||||||
gem 'pg', '~> 0.13.2'
|
gem 'pg', '~> 0.13.2'
|
||||||
# gem 'silent-postgres', :git => 'git://github.com/dolzenko/silent-postgres.git' #'~> 0.1.1'
|
# gem 'silent-postgres', :git => 'git://github.com/dolzenko/silent-postgres.git' #'~> 0.1.1'
|
||||||
|
@ -13,7 +13,7 @@ gem 'omniauth-openid', '~> 1.0.1'
|
||||||
gem 'cancan', '~> 1.6.7'
|
gem 'cancan', '~> 1.6.7'
|
||||||
|
|
||||||
gem 'ancestry', '~> 1.2.5'
|
gem 'ancestry', '~> 1.2.5'
|
||||||
gem 'paperclip', '~> 2.7.0'
|
gem 'paperclip', '~> 3.0.2'
|
||||||
gem 'delayed_job_active_record', '~> 0.3.2'
|
gem 'delayed_job_active_record', '~> 0.3.2'
|
||||||
gem 'russian', '~> 0.6.0'
|
gem 'russian', '~> 0.6.0'
|
||||||
gem 'highline', '~> 1.6.11'
|
gem 'highline', '~> 1.6.11'
|
||||||
|
@ -37,31 +37,31 @@ gem 'wikicloth'
|
||||||
|
|
||||||
gem 'unicorn', '~> 4.2.1', :platforms => [:mri, :rbx]
|
gem 'unicorn', '~> 4.2.1', :platforms => [:mri, :rbx]
|
||||||
gem 'trinidad', '~> 1.0.2', :platforms => :jruby
|
gem 'trinidad', '~> 1.0.2', :platforms => :jruby
|
||||||
gem 'newrelic_rpm', '~> 3.3.2', :platforms => [:mri, :rbx]
|
gem 'newrelic_rpm', '~> 3.3.3', :platforms => [:mri, :rbx]
|
||||||
gem 'whenever', '~> 0.7.3', :require => false
|
gem 'whenever', '~> 0.7.3', :require => false
|
||||||
|
|
||||||
gem 'rails3-jquery-autocomplete', '~> 1.0.6'
|
gem 'rails3-jquery-autocomplete', '~> 1.0.7'
|
||||||
gem 'will_paginate', '~> 3.0.3'
|
gem 'will_paginate', '~> 3.0.3'
|
||||||
gem 'meta-tags', '~> 1.2.5', :require => 'meta_tags'
|
gem 'meta-tags', '~> 1.2.5', :require => 'meta_tags'
|
||||||
gem "haml-rails", '~> 0.3.4'
|
gem "haml-rails", '~> 0.3.4'
|
||||||
gem 'ruby-haml-js'
|
|
||||||
gem 'rails-backbone'
|
|
||||||
gem 'jquery-rails', '~> 2.0.1'
|
|
||||||
gem 'state_machine', :require => 'state_machine/core'
|
gem 'state_machine', :require => 'state_machine/core'
|
||||||
|
gem 'jquery-rails', '~> 2.0.2'
|
||||||
|
gem 'ruby-haml-js', '~> 0.0.3'
|
||||||
|
gem 'rails-backbone', '~> 0.7.2'
|
||||||
|
|
||||||
group :assets do
|
group :assets do
|
||||||
gem 'sass-rails', '~> 3.2.5'
|
gem 'sass-rails', '~> 3.2.5'
|
||||||
gem 'coffee-rails', '~> 3.2.2'
|
gem 'coffee-rails', '~> 3.2.2'
|
||||||
gem 'compass-rails', '~> 1.0.1'
|
gem 'compass-rails', '~> 1.0.1'
|
||||||
gem 'uglifier', '~> 1.2.4'
|
gem 'uglifier', '~> 1.2.4'
|
||||||
gem 'therubyracer', '~> 0.10.0', :platforms => [:mri, :rbx]
|
gem 'therubyracer', '~> 0.10.1', :platforms => [:mri, :rbx]
|
||||||
gem 'therubyrhino', '~> 1.73.1', :platforms => :jruby
|
gem 'therubyrhino', '~> 1.73.1', :platforms => :jruby
|
||||||
end
|
end
|
||||||
|
|
||||||
group :production do
|
group :production do
|
||||||
gem "airbrake", '~> 3.0.9'
|
gem "airbrake", '~> 3.0.9'
|
||||||
gem 'bluepill', '~> 0.0.60', :require => false
|
gem 'bluepill', '~> 0.0.60', :require => false
|
||||||
gem 'daemons', '1.1.6' # for DJ
|
gem 'daemons', '1.1.6' # Try to upgrade 1.1.8 to avoid tons DJ bugs?
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
|
@ -77,7 +77,7 @@ end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'rspec-rails', '~> 2.9.0', :group => 'development'
|
gem 'rspec-rails', '~> 2.9.0', :group => 'development'
|
||||||
gem 'factory_girl_rails', '~> 3.0.0'
|
gem 'factory_girl_rails', '~> 3.1.0'
|
||||||
gem 'rr', '~> 1.0.4'
|
gem 'rr', '~> 1.0.4'
|
||||||
gem 'shoulda'
|
gem 'shoulda'
|
||||||
end
|
end
|
||||||
|
|
129
Gemfile.lock
129
Gemfile.lock
|
@ -25,32 +25,31 @@ GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
RedCloth (4.2.9)
|
RedCloth (4.2.9)
|
||||||
RedCloth (4.2.9-java)
|
actionmailer (3.2.3)
|
||||||
actionmailer (3.2.2)
|
actionpack (= 3.2.3)
|
||||||
actionpack (= 3.2.2)
|
mail (~> 2.4.4)
|
||||||
mail (~> 2.4.0)
|
actionpack (3.2.3)
|
||||||
actionpack (3.2.2)
|
activemodel (= 3.2.3)
|
||||||
activemodel (= 3.2.2)
|
activesupport (= 3.2.3)
|
||||||
activesupport (= 3.2.2)
|
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
journey (~> 1.0.1)
|
journey (~> 1.0.1)
|
||||||
rack (~> 1.4.0)
|
rack (~> 1.4.0)
|
||||||
rack-cache (~> 1.1)
|
rack-cache (~> 1.2)
|
||||||
rack-test (~> 0.6.1)
|
rack-test (~> 0.6.1)
|
||||||
sprockets (~> 2.1.2)
|
sprockets (~> 2.1.2)
|
||||||
activemodel (3.2.2)
|
activemodel (3.2.3)
|
||||||
activesupport (= 3.2.2)
|
activesupport (= 3.2.3)
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
activerecord (3.2.2)
|
activerecord (3.2.3)
|
||||||
activemodel (= 3.2.2)
|
activemodel (= 3.2.3)
|
||||||
activesupport (= 3.2.2)
|
activesupport (= 3.2.3)
|
||||||
arel (~> 3.0.2)
|
arel (~> 3.0.2)
|
||||||
tzinfo (~> 0.3.29)
|
tzinfo (~> 0.3.29)
|
||||||
activeresource (3.2.2)
|
activeresource (3.2.3)
|
||||||
activemodel (= 3.2.2)
|
activemodel (= 3.2.3)
|
||||||
activesupport (= 3.2.2)
|
activesupport (= 3.2.3)
|
||||||
activesupport (3.2.2)
|
activesupport (3.2.3)
|
||||||
i18n (~> 0.6)
|
i18n (~> 0.6)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
airbrake (3.0.9)
|
airbrake (3.0.9)
|
||||||
|
@ -62,7 +61,6 @@ GEM
|
||||||
activerecord (>= 2.2.2)
|
activerecord (>= 2.2.2)
|
||||||
arel (3.0.2)
|
arel (3.0.2)
|
||||||
bcrypt-ruby (3.0.1)
|
bcrypt-ruby (3.0.1)
|
||||||
bcrypt-ruby (3.0.1-java)
|
|
||||||
blankslate (2.1.2.4)
|
blankslate (2.1.2.4)
|
||||||
bluepill (0.0.60)
|
bluepill (0.0.60)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
|
@ -72,7 +70,7 @@ GEM
|
||||||
builder (3.0.0)
|
builder (3.0.0)
|
||||||
cancan (1.6.7)
|
cancan (1.6.7)
|
||||||
cape (1.4.0)
|
cape (1.4.0)
|
||||||
capistrano (2.11.2)
|
capistrano (2.12.0)
|
||||||
highline
|
highline
|
||||||
net-scp (>= 1.0.0)
|
net-scp (>= 1.0.0)
|
||||||
net-sftp (>= 2.0.0)
|
net-sftp (>= 2.0.0)
|
||||||
|
@ -89,7 +87,7 @@ GEM
|
||||||
coffee-script (2.2.0)
|
coffee-script (2.2.0)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.2.0)
|
coffee-script-source (1.3.1)
|
||||||
compass (0.12.1)
|
compass (0.12.1)
|
||||||
chunky_png (~> 1.2)
|
chunky_png (~> 1.2)
|
||||||
fssm (>= 0.2.7)
|
fssm (>= 0.2.7)
|
||||||
|
@ -98,7 +96,7 @@ GEM
|
||||||
compass (~> 0.12.0)
|
compass (~> 0.12.0)
|
||||||
creole (0.4.2)
|
creole (0.4.2)
|
||||||
daemons (1.1.6)
|
daemons (1.1.6)
|
||||||
delayed_job (3.0.1)
|
delayed_job (3.0.2)
|
||||||
activesupport (~> 3.0)
|
activesupport (~> 3.0)
|
||||||
delayed_job_active_record (0.3.2)
|
delayed_job_active_record (0.3.2)
|
||||||
activerecord (> 2.1.0)
|
activerecord (> 2.1.0)
|
||||||
|
@ -113,17 +111,16 @@ GEM
|
||||||
ejs (1.0.0)
|
ejs (1.0.0)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
eventmachine (0.12.10)
|
eventmachine (0.12.10)
|
||||||
eventmachine (0.12.10-java)
|
|
||||||
execjs (1.3.0)
|
execjs (1.3.0)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
expression_parser (0.9.0)
|
expression_parser (0.9.0)
|
||||||
factory_girl (3.0.0)
|
factory_girl (3.1.1)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
factory_girl_rails (3.0.0)
|
factory_girl_rails (3.1.0)
|
||||||
factory_girl (~> 3.0.0)
|
factory_girl (~> 3.1.0)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
fssm (0.2.8.1)
|
fssm (0.2.9)
|
||||||
github-markup (0.7.1)
|
github-markup (0.7.2)
|
||||||
gollum (1.3.1)
|
gollum (1.3.1)
|
||||||
albino (~> 1.3.2)
|
albino (~> 1.3.2)
|
||||||
github-markup (>= 0.4.0, < 1.0.0)
|
github-markup (>= 0.4.0, < 1.0.0)
|
||||||
|
@ -148,12 +145,10 @@ GEM
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
blankslate (>= 2.1.2.4)
|
blankslate (>= 2.1.2.4)
|
||||||
journey (1.0.3)
|
journey (1.0.3)
|
||||||
jquery-rails (2.0.1)
|
jquery-rails (2.0.2)
|
||||||
railties (>= 3.2.0, < 5.0)
|
railties (>= 3.2.0, < 5.0)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
jruby-rack (1.1.4)
|
|
||||||
json (1.6.6)
|
json (1.6.6)
|
||||||
json (1.6.6-java)
|
|
||||||
kgio (2.7.4)
|
kgio (2.7.4)
|
||||||
libv8 (3.3.10.4)
|
libv8 (3.3.10.4)
|
||||||
mail (2.4.4)
|
mail (2.4.4)
|
||||||
|
@ -172,7 +167,7 @@ GEM
|
||||||
meta-tags (1.2.6)
|
meta-tags (1.2.6)
|
||||||
actionpack
|
actionpack
|
||||||
mime-types (1.18)
|
mime-types (1.18)
|
||||||
multi_json (1.2.0)
|
multi_json (1.3.2)
|
||||||
mustache (0.99.4)
|
mustache (0.99.4)
|
||||||
net-scp (1.0.4)
|
net-scp (1.0.4)
|
||||||
net-ssh (>= 1.99.1)
|
net-ssh (>= 1.99.1)
|
||||||
|
@ -181,9 +176,8 @@ GEM
|
||||||
net-ssh (2.3.0)
|
net-ssh (2.3.0)
|
||||||
net-ssh-gateway (1.1.0)
|
net-ssh-gateway (1.1.0)
|
||||||
net-ssh (>= 1.99.1)
|
net-ssh (>= 1.99.1)
|
||||||
newrelic_rpm (3.3.2.1)
|
newrelic_rpm (3.3.4)
|
||||||
nokogiri (1.5.2)
|
nokogiri (1.5.2)
|
||||||
nokogiri (1.5.2-java)
|
|
||||||
omniauth (1.0.3)
|
omniauth (1.0.3)
|
||||||
hashie (~> 1.2)
|
hashie (~> 1.2)
|
||||||
rack
|
rack
|
||||||
|
@ -191,9 +185,10 @@ GEM
|
||||||
omniauth (~> 1.0)
|
omniauth (~> 1.0)
|
||||||
rack-openid (~> 1.3.1)
|
rack-openid (~> 1.3.1)
|
||||||
orm_adapter (0.0.7)
|
orm_adapter (0.0.7)
|
||||||
paperclip (2.7.0)
|
paperclip (3.0.2)
|
||||||
activerecord (>= 2.3.0)
|
activemodel (>= 3.0.0)
|
||||||
activesupport (>= 2.3.2)
|
activerecord (>= 3.0.0)
|
||||||
|
activesupport (>= 3.0.0)
|
||||||
cocaine (>= 0.0.2)
|
cocaine (>= 0.0.2)
|
||||||
mime-types
|
mime-types
|
||||||
pg (0.13.2)
|
pg (0.13.2)
|
||||||
|
@ -211,25 +206,25 @@ GEM
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.1)
|
rack-test (0.6.1)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (3.2.2)
|
rails (3.2.3)
|
||||||
actionmailer (= 3.2.2)
|
actionmailer (= 3.2.3)
|
||||||
actionpack (= 3.2.2)
|
actionpack (= 3.2.3)
|
||||||
activerecord (= 3.2.2)
|
activerecord (= 3.2.3)
|
||||||
activeresource (= 3.2.2)
|
activeresource (= 3.2.3)
|
||||||
activesupport (= 3.2.2)
|
activesupport (= 3.2.3)
|
||||||
bundler (~> 1.0)
|
bundler (~> 1.0)
|
||||||
railties (= 3.2.2)
|
railties (= 3.2.3)
|
||||||
rails-backbone (0.7.1)
|
rails-backbone (0.7.2)
|
||||||
coffee-script (~> 2.2.0)
|
coffee-script (~> 2.2.0)
|
||||||
ejs (~> 1.0.0)
|
ejs (~> 1.0.0)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
rails3-generators (0.17.4)
|
rails3-generators (0.17.4)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
rails3-jquery-autocomplete (1.0.6)
|
rails3-jquery-autocomplete (1.0.7)
|
||||||
rails (~> 3.0)
|
rails (~> 3.0)
|
||||||
railties (3.2.2)
|
railties (3.2.3)
|
||||||
actionpack (= 3.2.2)
|
actionpack (= 3.2.3)
|
||||||
activesupport (= 3.2.2)
|
activesupport (= 3.2.3)
|
||||||
rack-ssl (~> 1.3.2)
|
rack-ssl (~> 1.3.2)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
rdoc (~> 3.4)
|
rdoc (~> 3.4)
|
||||||
|
@ -246,7 +241,7 @@ GEM
|
||||||
rspec-expectations (~> 2.9.0)
|
rspec-expectations (~> 2.9.0)
|
||||||
rspec-mocks (~> 2.9.0)
|
rspec-mocks (~> 2.9.0)
|
||||||
rspec-core (2.9.0)
|
rspec-core (2.9.0)
|
||||||
rspec-expectations (2.9.0)
|
rspec-expectations (2.9.1)
|
||||||
diff-lcs (~> 1.1.3)
|
diff-lcs (~> 1.1.3)
|
||||||
rspec-mocks (2.9.0)
|
rspec-mocks (2.9.0)
|
||||||
rspec-rails (2.9.0)
|
rspec-rails (2.9.0)
|
||||||
|
@ -254,7 +249,7 @@ GEM
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
rspec (~> 2.9.0)
|
rspec (~> 2.9.0)
|
||||||
ruby-haml-js (0.0.2)
|
ruby-haml-js (0.0.3)
|
||||||
execjs
|
execjs
|
||||||
sprockets (>= 2.0.0)
|
sprockets (>= 2.0.0)
|
||||||
ruby-openid (2.1.8)
|
ruby-openid (2.1.8)
|
||||||
|
@ -262,7 +257,7 @@ GEM
|
||||||
i18n (>= 0.5.0)
|
i18n (>= 0.5.0)
|
||||||
sanitize (2.0.3)
|
sanitize (2.0.3)
|
||||||
nokogiri (>= 1.4.4, < 1.6)
|
nokogiri (>= 1.4.4, < 1.6)
|
||||||
sass (3.1.15)
|
sass (3.1.16)
|
||||||
sass-rails (3.2.5)
|
sass-rails (3.2.5)
|
||||||
railties (~> 3.2.0)
|
railties (~> 3.2.0)
|
||||||
sass (>= 3.1.10)
|
sass (>= 3.1.10)
|
||||||
|
@ -285,11 +280,10 @@ GEM
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
sqlite3 (1.3.5)
|
sqlite3 (1.3.6)
|
||||||
state_machine (1.1.2)
|
state_machine (1.1.2)
|
||||||
therubyracer (0.10.0)
|
therubyracer (0.10.1)
|
||||||
libv8 (~> 3.3.10)
|
libv8 (~> 3.3.10)
|
||||||
therubyrhino (1.73.1)
|
|
||||||
thin (1.3.1)
|
thin (1.3.1)
|
||||||
daemons (>= 1.0.9)
|
daemons (>= 1.0.9)
|
||||||
eventmachine (>= 0.12.6)
|
eventmachine (>= 0.12.6)
|
||||||
|
@ -299,11 +293,7 @@ GEM
|
||||||
treetop (1.4.10)
|
treetop (1.4.10)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
trinidad (1.0.5)
|
tzinfo (0.3.33)
|
||||||
jruby-rack (>= 1.0.2)
|
|
||||||
trinidad_jars (>= 0.3.0)
|
|
||||||
trinidad_jars (1.0.2)
|
|
||||||
tzinfo (0.3.32)
|
|
||||||
uglifier (1.2.4)
|
uglifier (1.2.4)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
multi_json (>= 1.0.2)
|
multi_json (>= 1.0.2)
|
||||||
|
@ -316,13 +306,12 @@ GEM
|
||||||
whenever (0.7.3)
|
whenever (0.7.3)
|
||||||
activesupport (>= 2.3.4)
|
activesupport (>= 2.3.4)
|
||||||
chronic (~> 0.6.3)
|
chronic (~> 0.6.3)
|
||||||
wikicloth (0.7.1)
|
wikicloth (0.8.0)
|
||||||
builder
|
builder
|
||||||
expression_parser
|
expression_parser
|
||||||
will_paginate (3.0.3)
|
will_paginate (3.0.3)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
java
|
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
@ -342,7 +331,7 @@ DEPENDENCIES
|
||||||
delayed_job_active_record (~> 0.3.2)
|
delayed_job_active_record (~> 0.3.2)
|
||||||
devise (~> 2.0.4)
|
devise (~> 2.0.4)
|
||||||
diff-display (~> 0.0.1)
|
diff-display (~> 0.0.1)
|
||||||
factory_girl_rails (~> 3.0.0)
|
factory_girl_rails (~> 3.1.0)
|
||||||
gollum (= 1.3.1)
|
gollum (= 1.3.1)
|
||||||
grack!
|
grack!
|
||||||
grit!
|
grit!
|
||||||
|
@ -350,30 +339,30 @@ DEPENDENCIES
|
||||||
highline (~> 1.6.11)
|
highline (~> 1.6.11)
|
||||||
hirb
|
hirb
|
||||||
jbuilder
|
jbuilder
|
||||||
jquery-rails (~> 2.0.1)
|
jquery-rails (~> 2.0.2)
|
||||||
mailcatcher
|
mailcatcher
|
||||||
meta-tags (~> 1.2.5)
|
meta-tags (~> 1.2.5)
|
||||||
newrelic_rpm (~> 3.3.2)
|
newrelic_rpm (~> 3.3.3)
|
||||||
omniauth (~> 1.0.3)
|
omniauth (~> 1.0.3)
|
||||||
omniauth-openid (~> 1.0.1)
|
omniauth-openid (~> 1.0.1)
|
||||||
paperclip (~> 2.7.0)
|
paperclip (~> 3.0.2)
|
||||||
pg (~> 0.13.2)
|
pg (~> 0.13.2)
|
||||||
rails (= 3.2.2)
|
rails (= 3.2.3)
|
||||||
rails-backbone
|
rails-backbone (~> 0.7.2)
|
||||||
rails3-generators
|
rails3-generators
|
||||||
rails3-jquery-autocomplete (~> 1.0.6)
|
rails3-jquery-autocomplete (~> 1.0.7)
|
||||||
rdiscount
|
rdiscount
|
||||||
redcarpet (= 1.17.2)
|
redcarpet (= 1.17.2)
|
||||||
redhillonrails_core!
|
redhillonrails_core!
|
||||||
rr (~> 1.0.4)
|
rr (~> 1.0.4)
|
||||||
rspec-rails (~> 2.9.0)
|
rspec-rails (~> 2.9.0)
|
||||||
ruby-haml-js
|
ruby-haml-js (~> 0.0.3)
|
||||||
russian (~> 0.6.0)
|
russian (~> 0.6.0)
|
||||||
sass-rails (~> 3.2.5)
|
sass-rails (~> 3.2.5)
|
||||||
shotgun
|
shotgun
|
||||||
shoulda
|
shoulda
|
||||||
state_machine
|
state_machine
|
||||||
therubyracer (~> 0.10.0)
|
therubyracer (~> 0.10.1)
|
||||||
therubyrhino (~> 1.73.1)
|
therubyrhino (~> 1.73.1)
|
||||||
trinidad (~> 1.0.2)
|
trinidad (~> 1.0.2)
|
||||||
uglifier (~> 1.2.4)
|
uglifier (~> 1.2.4)
|
||||||
|
|
|
@ -72,7 +72,7 @@ header div.right {
|
||||||
background: image-url("top-right.png");
|
background: image-url("top-right.png");
|
||||||
height: 46px;
|
height: 46px;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
float: right;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Left part of top menu*/
|
/* Left part of top menu*/
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Admin::BaseController < ApplicationController
|
||||||
|
before_filter :authenticate_user!
|
||||||
|
load_and_authorize_resource
|
||||||
|
end
|
|
@ -1,8 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class EventLogsController < ApplicationController
|
class Admin::EventLogsController < Admin::BaseController
|
||||||
before_filter :authenticate_user!
|
|
||||||
load_and_authorize_resource
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@event_logs = EventLog.default_order.eager_loading.paginate :page => params[:page]
|
@event_logs = EventLog.default_order.eager_loading.paginate :page => params[:page]
|
||||||
end
|
end
|
|
@ -0,0 +1,21 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Admin::RegisterRequestsController < Admin::BaseController
|
||||||
|
def index
|
||||||
|
@register_requests = @register_requests.send((params[:scope] || 'unprocessed').to_sym).paginate(:page => params[:page])
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
RegisterRequest.where(:id => params[:request_ids]).each(¶ms[:update_type].to_sym) if params[:update_type].present? && params[:request_ids].present?
|
||||||
|
redirect_to :action => :index
|
||||||
|
end
|
||||||
|
|
||||||
|
def approve
|
||||||
|
@register_request.approve
|
||||||
|
redirect_to :action => :index
|
||||||
|
end
|
||||||
|
|
||||||
|
def reject
|
||||||
|
@register_request.reject
|
||||||
|
redirect_to :action => :index
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,7 +1,6 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class Admin::UsersController < ApplicationController
|
class Admin::UsersController < Admin::BaseController
|
||||||
before_filter :authenticate_user!
|
prepend_before_filter :find_user
|
||||||
load_and_authorize_resource
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@filter = params[:filter] || 'all'
|
@filter = params[:filter] || 'all'
|
||||||
|
@ -15,7 +14,7 @@ class Admin::UsersController < ApplicationController
|
||||||
@user.confirmed_at = Time.now.utc
|
@user.confirmed_at = Time.now.utc
|
||||||
if @user.save
|
if @user.save
|
||||||
flash[:notice] = t('flash.user.saved')
|
flash[:notice] = t('flash.user.saved')
|
||||||
redirect_to users_path
|
redirect_to admin_users_path
|
||||||
else
|
else
|
||||||
flash[:error] = t('flash.user.save_error')
|
flash[:error] = t('flash.user.save_error')
|
||||||
flash[:warning] = @user.errors.full_messages.join('. ')
|
flash[:warning] = @user.errors.full_messages.join('. ')
|
||||||
|
@ -23,7 +22,7 @@ class Admin::UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def profile
|
def edit
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
@ -34,18 +33,18 @@ class Admin::UsersController < ApplicationController
|
||||||
@user.save
|
@user.save
|
||||||
end
|
end
|
||||||
flash[:notice] = t('flash.user.saved')
|
flash[:notice] = t('flash.user.saved')
|
||||||
redirect_to users_path#edit_user_path(@user)
|
redirect_to admin_users_path
|
||||||
else
|
else
|
||||||
flash[:error] = t('flash.user.save_error')
|
flash[:error] = t('flash.user.save_error')
|
||||||
flash[:warning] = @user.errors.full_messages.join('. ')
|
flash[:warning] = @user.errors.full_messages.join('. ')
|
||||||
render(:action => :profile)
|
render :action => :edit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@user.destroy
|
@user.destroy
|
||||||
flash[:notice] = t("flash.user.destroyed")
|
flash[:notice] = t("flash.user.destroyed")
|
||||||
redirect_to users_path
|
redirect_to admin_users_path
|
||||||
end
|
end
|
||||||
|
|
||||||
def list
|
def list
|
||||||
|
@ -64,6 +63,12 @@ class Admin::UsersController < ApplicationController
|
||||||
@total_user = @users.count
|
@total_user = @users.count
|
||||||
@users = @users.order(order)
|
@users = @users.order(order)
|
||||||
|
|
||||||
render :partial =>'users_ajax', :layout => false
|
render :partial => 'users_ajax', :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def find_user
|
||||||
|
@user = User.find_by_uname!(params[:id]) if params[:id]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
# -*- encoding : utf-8 -*-
|
|
||||||
class Git::BaseController < ApplicationController
|
|
||||||
before_filter :authenticate_user!
|
|
||||||
skip_before_filter :authenticate_user!, :only => [:show, :index, :blame, :raw, :archive] if APP_CONFIG['anonymous_access']
|
|
||||||
load_and_authorize_resource :project
|
|
||||||
|
|
||||||
before_filter :find_git_repository
|
|
||||||
before_filter :find_tags
|
|
||||||
before_filter :find_branches
|
|
||||||
before_filter :set_treeish
|
|
||||||
before_filter :set_current_tag
|
|
||||||
before_filter :set_current_branch
|
|
||||||
|
|
||||||
protected
|
|
||||||
def find_git_repository
|
|
||||||
@git_repository = @project.git_repository
|
|
||||||
end
|
|
||||||
|
|
||||||
def find_tags
|
|
||||||
@tags = @git_repository.tags
|
|
||||||
end
|
|
||||||
|
|
||||||
def find_branches
|
|
||||||
@branches = @git_repository.branches
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_treeish
|
|
||||||
@treeish = params[:treeish].presence || @project.default_branch
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_current_tag
|
|
||||||
@current_tag = @tags.select{|t| t.name == @treeish }.first
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_current_branch
|
|
||||||
@current_branch = @branches.select{|b| b.name == @treeish }.first
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Groups::BaseController < ApplicationController
|
||||||
|
before_filter :authenticate_user!
|
||||||
|
before_filter :find_group
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def find_group
|
||||||
|
if group_id = params[:owner_name] || params[:group_id] || params[:id]
|
||||||
|
@group = Group.find_by_insensitive_uname! group_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,57 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Groups::MembersController < Groups::BaseController
|
||||||
|
is_related_controller!
|
||||||
|
belongs_to :group, :finder => 'find_by_insensitive_uname!', :optional => true
|
||||||
|
|
||||||
|
before_filter lambda { authorize! :manage_members, @group }
|
||||||
|
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
params['user'].keys.each do |user_id|
|
||||||
|
role = params['user'][user_id]
|
||||||
|
if relation = parent.actors.where(:actor_id => user_id, :actor_type => 'User') #find_by_actor_id_and_actor_type(user_id, 'User')
|
||||||
|
relation.update_all(:role => role) if parent.owner.id.to_s != user_id
|
||||||
|
else
|
||||||
|
relation = parent.actors.build(:actor_id => user_id, :actor_type => 'User', :role => role)
|
||||||
|
relation.save!
|
||||||
|
end
|
||||||
|
end if params['user']
|
||||||
|
if parent.save
|
||||||
|
flash[:notice] = t("flash.members.successfully_changed")
|
||||||
|
else
|
||||||
|
flash[:error] = t("flash.members.error_in_changing")
|
||||||
|
end
|
||||||
|
redirect_to group_members_path(parent)
|
||||||
|
end
|
||||||
|
|
||||||
|
def remove
|
||||||
|
all_user_ids = []
|
||||||
|
params['user_remove'].each do |user_id, remove|
|
||||||
|
all_user_ids << user_id if remove == ["1"] && parent.owner.id.to_s != user_id
|
||||||
|
end if params['user_remove']
|
||||||
|
all_user_ids.each do |user_id|
|
||||||
|
u = User.find(user_id)
|
||||||
|
Relation.by_actor(u).by_target(parent).each {|r| r.destroy}
|
||||||
|
end
|
||||||
|
redirect_to group_members_path(parent)
|
||||||
|
end
|
||||||
|
|
||||||
|
def add
|
||||||
|
if params['user_id'] and !params['user_id'].empty?
|
||||||
|
@user = User.find_by_uname(params['user_id'])
|
||||||
|
unless parent.actors.exists? :actor_id => @user.id, :actor_type => 'User'
|
||||||
|
relation = parent.actors.build(:actor_id => @user.id, :actor_type => 'User', :role => params[:role])
|
||||||
|
if relation.save
|
||||||
|
flash[:notice] = t("flash.members.successfully_added")
|
||||||
|
else
|
||||||
|
flash[:error] = t("flash.members.error_in_adding")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
flash[:error] = t("flash.members.already_added")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
redirect_to group_members_path(parent)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,55 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Groups::ProfileController < Groups::BaseController
|
||||||
|
load_and_authorize_resource :class => Group, :instance_name => 'group'
|
||||||
|
|
||||||
|
autocomplete :group, :uname
|
||||||
|
|
||||||
|
def index
|
||||||
|
@groups = current_user.groups.paginate(:page => params[:group_page]) # accessible_by(current_ability)
|
||||||
|
@groups = @groups.search(params[:query]) if params[:query].present?
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@projects = @group.projects #.paginate(:page => params[:project_page], :per_page => 10)
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@group = Group.new params[:group]
|
||||||
|
@group.owner = current_user
|
||||||
|
if @group.save
|
||||||
|
flash[:notice] = t('flash.group.saved')
|
||||||
|
redirect_to group_path(@group)
|
||||||
|
else
|
||||||
|
flash[:error] = t('flash.group.save_error')
|
||||||
|
flash[:warning] = @group.errors.full_messages.join('. ')
|
||||||
|
render :action => :new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
if @group.update_attributes(params[:group])
|
||||||
|
flash[:notice] = t('flash.group.saved')
|
||||||
|
redirect_to group_path(@group)
|
||||||
|
else
|
||||||
|
flash[:error] = t('flash.group.save_error')
|
||||||
|
render :action => :edit
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@group.destroy
|
||||||
|
flash[:notice] = t("flash.group.destroyed")
|
||||||
|
redirect_to groups_path
|
||||||
|
end
|
||||||
|
|
||||||
|
def remove_user
|
||||||
|
Relation.by_object(current_user).by_target(@group).destroy_all
|
||||||
|
redirect_to groups_path
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,71 +0,0 @@
|
||||||
# -*- encoding : utf-8 -*-
|
|
||||||
class GroupsController < ApplicationController
|
|
||||||
is_related_controller!
|
|
||||||
|
|
||||||
belongs_to :user, :optional => true
|
|
||||||
|
|
||||||
before_filter :authenticate_user!
|
|
||||||
before_filter :find_group, :only => [:show, :edit, :update, :destroy]
|
|
||||||
|
|
||||||
load_and_authorize_resource :except => :create
|
|
||||||
authorize_resource :only => :create
|
|
||||||
autocomplete :group, :uname
|
|
||||||
|
|
||||||
def index
|
|
||||||
@groups = current_user.groups#accessible_by(current_ability)
|
|
||||||
|
|
||||||
@groups = if params[:query]
|
|
||||||
@groups.where(["name LIKE ?", "%#{params[:query]}%"])
|
|
||||||
else
|
|
||||||
@groups
|
|
||||||
end.paginate(:page => params[:group_page])
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
@projects = @group.projects.paginate(:page => params[:project_page], :per_page => 10)
|
|
||||||
end
|
|
||||||
|
|
||||||
def new
|
|
||||||
@group = Group.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def edit
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
@group = Group.new(:description => params[:group][:description])
|
|
||||||
@group.owner = current_user
|
|
||||||
@group.uname = params[:group][:uname]
|
|
||||||
|
|
||||||
if @group.save
|
|
||||||
flash[:notice] = t('flash.group.saved')
|
|
||||||
redirect_to group_path(@group)
|
|
||||||
else
|
|
||||||
flash[:error] = t('flash.group.save_error')
|
|
||||||
flash[:warning] = @group.errors.full_messages.join('. ')
|
|
||||||
render :action => :new
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
if @group.update_attributes(params[:group])
|
|
||||||
flash[:notice] = t('flash.group.saved')
|
|
||||||
redirect_to group_path(@group)
|
|
||||||
else
|
|
||||||
flash[:error] = t('flash.group.save_error')
|
|
||||||
render :action => :edit
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
@group.destroy
|
|
||||||
flash[:notice] = t("flash.group.destroyed")
|
|
||||||
redirect_to groups_path
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def find_group
|
|
||||||
@group = Group.find(params[:id])
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,98 +0,0 @@
|
||||||
# -*- encoding : utf-8 -*-
|
|
||||||
class MembersController < ApplicationController
|
|
||||||
before_filter :authenticate_user!
|
|
||||||
is_related_controller!
|
|
||||||
|
|
||||||
belongs_to :group, :optional => true
|
|
||||||
|
|
||||||
# before_filter :find_target
|
|
||||||
before_filter :find_users
|
|
||||||
|
|
||||||
def index
|
|
||||||
redirect_to edit_group_members_path(parent)
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
end
|
|
||||||
|
|
||||||
def new
|
|
||||||
end
|
|
||||||
|
|
||||||
def edit
|
|
||||||
if params[:id]
|
|
||||||
@user = User.find params[:id]
|
|
||||||
render :edit_rights and return
|
|
||||||
end
|
|
||||||
@group = parent
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
params['user'].keys.each { |user_id|
|
|
||||||
role = params['user'][user_id]
|
|
||||||
|
|
||||||
if relation = parent.actors.where(:actor_id => user_id, :actor_type => 'User') #find_by_actor_id_and_actor_type(user_id, 'User')
|
|
||||||
relation.update_attribute(:role, role)
|
|
||||||
else
|
|
||||||
relation = parent.actors.build(:actor_id => user_id, :actor_type => 'User', :role => role)
|
|
||||||
relation.save!
|
|
||||||
end
|
|
||||||
} if params['user']
|
|
||||||
|
|
||||||
if parent.save
|
|
||||||
flash[:notice] = t("flash.members.successfully_changed")
|
|
||||||
else
|
|
||||||
flash[:error] = t("flash.members.error_in_changing")
|
|
||||||
end
|
|
||||||
|
|
||||||
redirect_to edit_group_members_path(parent)
|
|
||||||
end
|
|
||||||
|
|
||||||
def remove
|
|
||||||
if params[:id]
|
|
||||||
u = User.find(params[:id])
|
|
||||||
Relation.by_actor(u).by_target(parent)[0].destroy
|
|
||||||
|
|
||||||
redirect_to groups_path
|
|
||||||
else
|
|
||||||
all_user_ids = []
|
|
||||||
|
|
||||||
params['user_remove'].keys.each { |user_id|
|
|
||||||
all_user_ids << user_id if params['user_remove'][user_id] == ["1"]
|
|
||||||
} if params['user_remove']
|
|
||||||
|
|
||||||
all_user_ids.each do |user_id|
|
|
||||||
u = User.find(user_id)
|
|
||||||
Relation.by_actor(u).by_target(parent).each {|r| r.destroy}
|
|
||||||
end
|
|
||||||
|
|
||||||
redirect_to edit_group_members_path(parent)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def add
|
|
||||||
if params['user_id'] and !params['user_id'].empty?
|
|
||||||
@user = User.find_by_uname(params['user_id'])
|
|
||||||
unless parent.actors.exists? :actor_id => @user.id, :actor_type => 'User'
|
|
||||||
relation = parent.actors.build(:actor_id => @user.id, :actor_type => 'User', :role => params[:role])
|
|
||||||
if relation.save
|
|
||||||
flash[:notice] = t("flash.members.successfully_added")
|
|
||||||
else
|
|
||||||
flash[:error] = t("flash.members.error_in_adding")
|
|
||||||
end
|
|
||||||
else
|
|
||||||
flash[:error] = t("flash.members.already_added")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
redirect_to edit_group_members_path(parent)
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def find_users
|
|
||||||
@users = parent.members #User.all
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Platforms::BaseController < ApplicationController
|
||||||
|
end
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class PlatformsController < ApplicationController
|
class Platforms::PlatformsController < Platforms::BaseController
|
||||||
|
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
@ -17,7 +17,6 @@ class PlatformsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class PrivateUsersController < ApplicationController
|
class Platforms::PrivateUsersController < Platforms::BaseController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_filter :find_platform_and_private_users
|
before_filter :find_platform_and_private_users
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class PrivatesController < ApplicationController
|
class Platforms::PrivatesController < Platforms::BaseController
|
||||||
require 'digest/sha2'
|
require 'digest/sha2'
|
||||||
|
|
||||||
before_filter :find_platform
|
before_filter :find_platform
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class ProductBuildListsController < ApplicationController
|
class Platforms::ProductBuildListsController < Platforms::BaseController
|
||||||
before_filter :authenticate_user!, :except => [:status_build]
|
before_filter :authenticate_user!, :except => [:status_build]
|
||||||
skip_before_filter :authenticate_user!, :only => [:index] if APP_CONFIG['anonymous_access']
|
skip_before_filter :authenticate_user!, :only => [:index] if APP_CONFIG['anonymous_access']
|
||||||
load_and_authorize_resource :platform, :only => [:create, :destroy]
|
load_and_authorize_resource :platform, :only => [:create, :destroy]
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class ProductsController < ApplicationController
|
class Platforms::ProductsController < Platforms::BaseController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
|
||||||
load_and_authorize_resource :platform
|
load_and_authorize_resource :platform
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class RepositoriesController < ApplicationController
|
class Platforms::RepositoriesController < Platforms::BaseController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
|
||||||
load_and_authorize_resource :platform
|
load_and_authorize_resource :platform
|
|
@ -0,0 +1,10 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Projects::BaseController < ApplicationController
|
||||||
|
prepend_before_filter :find_project
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def find_project
|
||||||
|
@project = Project.find_by_owner_and_name!(params[:owner_name], params[:project_name]) if params[:owner_name] && params[:project_name]
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,15 +1,14 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class BuildListsController < ApplicationController
|
class Projects::BuildListsController < Projects::BaseController
|
||||||
CALLBACK_ACTIONS = [:publish_build, :status_build, :pre_build, :post_build, :circle_build, :new_bbdt]
|
CALLBACK_ACTIONS = [:publish_build, :status_build, :pre_build, :post_build, :circle_build, :new_bbdt]
|
||||||
NESTED_ACTIONS = [:search, :index, :new, :create]
|
NESTED_ACTIONS = [:search, :index, :new, :create]
|
||||||
|
|
||||||
before_filter :authenticate_user!, :except => CALLBACK_ACTIONS
|
before_filter :authenticate_user!, :except => CALLBACK_ACTIONS
|
||||||
before_filter :authenticate_build_service!, :only => CALLBACK_ACTIONS
|
before_filter :authenticate_build_service!, :only => CALLBACK_ACTIONS
|
||||||
skip_before_filter :authenticate_user!, :only => [:show, :index, :search] if APP_CONFIG['anonymous_access']
|
skip_before_filter :authenticate_user!, :only => [:show, :index, :search] if APP_CONFIG['anonymous_access']
|
||||||
before_filter :find_project, :only => NESTED_ACTIONS
|
|
||||||
before_filter :find_build_list, :only => [:show, :publish, :cancel, :reject_publish]
|
before_filter :find_build_list, :only => [:show, :publish, :cancel]
|
||||||
before_filter :find_build_list_by_bs, :only => [:publish_build, :status_build, :pre_build, :post_build, :circle_build]
|
before_filter :find_build_list_by_bs, :only => [:publish_build, :status_build, :pre_build, :post_build, :circle_build]
|
||||||
before_filter :find_platform, :only => [:create]
|
|
||||||
|
|
||||||
load_and_authorize_resource :project, :only => NESTED_ACTIONS
|
load_and_authorize_resource :project, :only => NESTED_ACTIONS
|
||||||
load_and_authorize_resource :build_list, :through => :project, :only => NESTED_ACTIONS, :shallow => true
|
load_and_authorize_resource :build_list, :through => :project, :only => NESTED_ACTIONS, :shallow => true
|
||||||
|
@ -36,12 +35,12 @@ class BuildListsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@build_list = BuildList.new
|
# @build_list = BuildList.new # @build_list already created by CanCan
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
notices, errors = [], []
|
notices, errors = [], []
|
||||||
# Disable auto_publish if platform released
|
@platform = Platform.find params[:build_list][:pl_id]
|
||||||
params[:build_list][:auto_publish] = false if @platform.released
|
params[:build_list][:auto_publish] = false if @platform.released
|
||||||
Arch.where(:id => params[:arches]).each do |arch|
|
Arch.where(:id => params[:arches]).each do |arch|
|
||||||
Platform.main.where(:id => params[:bpls]).each do |bpl|
|
Platform.main.where(:id => params[:bpls]).each do |bpl|
|
||||||
|
@ -160,14 +159,6 @@ class BuildListsController < ApplicationController
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def find_project
|
|
||||||
@project = Project.find_by_id params[:project_id]
|
|
||||||
end
|
|
||||||
|
|
||||||
def find_platform
|
|
||||||
@platform = Platform.find params[:build_list][:pl_id]
|
|
||||||
end
|
|
||||||
|
|
||||||
def find_build_list
|
def find_build_list
|
||||||
@build_list = BuildList.find(params[:id])
|
@build_list = BuildList.find(params[:id])
|
||||||
end
|
end
|
|
@ -1,16 +1,14 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class CollaboratorsController < ApplicationController
|
class Projects::CollaboratorsController < Projects::BaseController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
|
||||||
before_filter :find_project
|
|
||||||
before_filter :find_users
|
|
||||||
before_filter :find_groups
|
|
||||||
|
|
||||||
load_resource :project
|
load_resource :project
|
||||||
before_filter :authorize_collaborators
|
before_filter :authorize_collaborators
|
||||||
|
|
||||||
|
before_filter :find_users
|
||||||
|
before_filter :find_groups
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@collaborators = Collaborator.find_by_project(@project)
|
@collaborators = Collaborator.find_by_project(@project)
|
||||||
respond_with @collaborators
|
respond_with @collaborators
|
||||||
|
@ -67,10 +65,6 @@ class CollaboratorsController < ApplicationController
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def find_project
|
|
||||||
@project = Project.find params[:project_id]
|
|
||||||
end
|
|
||||||
|
|
||||||
def find_users
|
def find_users
|
||||||
@users = @project.collaborators.order('uname')#User.all
|
@users = @project.collaborators.order('uname')#User.all
|
||||||
@users = @users.without(@project.owner_id) if @project.owner_type == 'User'
|
@users = @users.without(@project.owner_id) if @project.owner_type == 'User'
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class CommentsController < ApplicationController
|
class Projects::CommentsController < Projects::BaseController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
load_and_authorize_resource :project
|
load_and_authorize_resource :project
|
||||||
before_filter :find_commentable
|
before_filter :find_commentable
|
|
@ -1,7 +1,6 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class CommitSubscribesController < ApplicationController
|
class Projects::CommitSubscribesController < Projects::BaseController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
|
||||||
load_and_authorize_resource :project
|
load_and_authorize_resource :project
|
||||||
|
|
||||||
before_filter :find_commit
|
before_filter :find_commit
|
|
@ -0,0 +1,39 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Projects::Git::BaseController < Projects::BaseController
|
||||||
|
before_filter :authenticate_user!
|
||||||
|
skip_before_filter :authenticate_user!, :only => [:show, :index, :blame, :raw, :archive] if APP_CONFIG['anonymous_access']
|
||||||
|
load_and_authorize_resource :project
|
||||||
|
|
||||||
|
before_filter :find_git_repository
|
||||||
|
before_filter :find_tags
|
||||||
|
before_filter :find_branches
|
||||||
|
before_filter :set_treeish
|
||||||
|
before_filter :set_current_tag
|
||||||
|
before_filter :set_current_branch
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def find_git_repository
|
||||||
|
@git_repository = @project.git_repository
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_tags
|
||||||
|
@tags = @git_repository.tags
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_branches
|
||||||
|
@branches = @git_repository.branches
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_treeish
|
||||||
|
@treeish = params[:treeish].presence || @project.default_branch
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_current_tag
|
||||||
|
@current_tag = @tags.select{|t| t.name == @treeish }.first
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_current_branch
|
||||||
|
@current_branch = @branches.select{|b| b.name == @treeish }.first
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class Git::BlobsController < Git::BaseController
|
class Projects::Git::BlobsController < Projects::Git::BaseController
|
||||||
before_filter :find_tree
|
before_filter :find_tree
|
||||||
before_filter :find_branch
|
before_filter :find_branch
|
||||||
before_filter :set_path_blob
|
before_filter :set_path_blob
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class Git::CommitsController < Git::BaseController
|
class Projects::Git::CommitsController < Projects::Git::BaseController
|
||||||
helper_method :split_commits_by_date
|
helper_method :split_commits_by_date
|
||||||
|
|
||||||
def index
|
def index
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class Git::TreesController < Git::BaseController
|
class Projects::Git::TreesController < Projects::Git::BaseController
|
||||||
def show
|
def show
|
||||||
redirect_to project_path(@project) and return if params[:treeish] == @project.default_branch and params[:path].blank?
|
redirect_to project_path(@project) and return if params[:treeish] == @project.default_branch and params[:path].blank?
|
||||||
|
|
||||||
|
@ -10,10 +10,9 @@ class Git::TreesController < Git::BaseController
|
||||||
# @commit = @git_repository.commits(@treeish, 1).first
|
# @commit = @git_repository.commits(@treeish, 1).first
|
||||||
# Raises Grit::Git::GitTimeout
|
# Raises Grit::Git::GitTimeout
|
||||||
@commit = @branch.present? ? @branch.commit() : @git_repository.log(@treeish, @path, :max_count => 1).first
|
@commit = @branch.present? ? @branch.commit() : @git_repository.log(@treeish, @path, :max_count => 1).first
|
||||||
render :template => "git/trees/empty" and return unless @commit
|
render "empty" and return unless @commit
|
||||||
|
|
||||||
@tree = @tree / @path if @path
|
@tree = @tree / @path if @path
|
||||||
render :template => "git/trees/show"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def archive
|
def archive
|
||||||
|
@ -28,8 +27,6 @@ class Git::TreesController < Git::BaseController
|
||||||
file = Tempfile.new fullname, 'tmp'
|
file = Tempfile.new fullname, 'tmp'
|
||||||
system("cd #{@project.path}; git archive --format=#{format} --prefix=#{name}/ #{treeish} #{format == 'tar' ? ' | gzip -9' : ''} > #{file.path}")
|
system("cd #{@project.path}; git archive --format=#{format} --prefix=#{name}/ #{treeish} #{format == 'tar' ? ' | gzip -9' : ''} > #{file.path}")
|
||||||
file.close
|
file.close
|
||||||
send_file file.path, :disposition => 'attachment', :type => "application/#{format == 'tar' ? 'x-tar-gz' : 'zip'}",
|
send_file file.path, :disposition => 'attachment', :type => "application/#{format == 'tar' ? 'x-tar-gz' : 'zip'}", :filename => fullname
|
||||||
:filename => fullname
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class IssuesController < ApplicationController
|
class Projects::IssuesController < Projects::BaseController
|
||||||
NON_RESTFUL_ACTION = [:create_label, :update_label, :destroy_label, :search_collaborators]
|
NON_RESTFUL_ACTION = [:create_label, :update_label, :destroy_label, :search_collaborators]
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
skip_before_filter :authenticate_user!, :only => [:index, :show] if APP_CONFIG['anonymous_access']
|
skip_before_filter :authenticate_user!, :only => [:index, :show] if APP_CONFIG['anonymous_access']
|
||||||
|
@ -54,12 +54,12 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if params[:issue] && state = params[:issue][:state]
|
if params[:issue] && status = params[:issue][:status]
|
||||||
action = 'issues/_status'
|
action = 'status'
|
||||||
@issue.set_close(current_user) if state == 'closed'
|
@issue.set_close(current_user) if status == 'closed'
|
||||||
@issue.set_open if state == 'open'
|
@issue.set_open if status == 'open'
|
||||||
status = 200 if @issue.save
|
status = 200 if @issue.save
|
||||||
render action, :status => (status || 500), :layout => false
|
render :partial => action, :status => (status || 500), :layout => false
|
||||||
elsif params[:issue]
|
elsif params[:issue]
|
||||||
@issue.labelings.destroy_all if params[:issue][:labelings_attributes] # FIXME
|
@issue.labelings.destroy_all if params[:issue][:labelings_attributes] # FIXME
|
||||||
status = 200 if @issue.update_attributes(params[:issue])
|
status = 200 if @issue.update_attributes(params[:issue])
|
||||||
|
@ -77,12 +77,12 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_label
|
def create_label
|
||||||
status = @project.labels.create(:name => params[:name], :color => params[:color]) ? 200 : 500
|
status = @project.labels.create!(:name => params[:name], :color => params[:color]) ? 200 : 500
|
||||||
index(status)
|
index(status)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_label
|
def update_label
|
||||||
status = @label.update_attributes( :name => params[:name], :color => params[:color]) ? 200 : 500
|
status = @label.update_attributes(:name => params[:name], :color => params[:color]) ? 200 : 500
|
||||||
index(status)
|
index(status)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class IssuesController < ApplicationController
|
||||||
users = User.joins(:groups => :projects).where(:projects => {:id => @project.id}).where("users.uname ILIKE ?", search)
|
users = User.joins(:groups => :projects).where(:projects => {:id => @project.id}).where("users.uname ILIKE ?", search)
|
||||||
users2 = @project.collaborators.where("users.uname ILIKE ?", search)
|
users2 = @project.collaborators.where("users.uname ILIKE ?", search)
|
||||||
@users = (users + users2).uniq.sort {|x,y| x.uname <=> y.uname}.first(10)
|
@users = (users + users2).uniq.sort {|x,y| x.uname <=> y.uname}.first(10)
|
||||||
render 'issues/_search_collaborators', :layout => false
|
render :partial => 'search_collaborators', :layout => false
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class ProjectsController < ApplicationController
|
class Projects::ProjectsController < Projects::BaseController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
|
@ -57,6 +57,7 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def fork
|
def fork
|
||||||
|
authorize! :fork, @project # TODO WTF ?
|
||||||
owner = (Group.find params[:group] if params[:group].present?) || current_user
|
owner = (Group.find params[:group] if params[:group].present?) || current_user
|
||||||
authorize! :update, owner if owner.class == Group
|
authorize! :update, owner if owner.class == Group
|
||||||
if forked = @project.fork(owner) and forked.valid?
|
if forked = @project.fork(owner) and forked.valid?
|
||||||
|
@ -72,11 +73,11 @@ class ProjectsController < ApplicationController
|
||||||
if request.post?
|
if request.post?
|
||||||
if @project.update_attributes(params[:project])
|
if @project.update_attributes(params[:project])
|
||||||
flash[:notice] = t('flash.project.saved')
|
flash[:notice] = t('flash.project.saved')
|
||||||
|
redirect_to sections_project_path(@project)
|
||||||
else
|
else
|
||||||
@project.save
|
@project.save
|
||||||
flash[:error] = t('flash.project.save_error')
|
flash[:error] = t('flash.project.save_error')
|
||||||
end
|
end
|
||||||
render :action => :sections
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class SubscribesController < ApplicationController
|
class Projects::SubscribesController < Projects::BaseController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
|
||||||
load_and_authorize_resource :project
|
load_and_authorize_resource :project
|
|
@ -2,7 +2,7 @@
|
||||||
#require 'lib/gollum'
|
#require 'lib/gollum'
|
||||||
require 'cgi'
|
require 'cgi'
|
||||||
|
|
||||||
class WikiController < ApplicationController
|
class Projects::WikiController < Projects::BaseController
|
||||||
WIKI_OPTIONS = {}
|
WIKI_OPTIONS = {}
|
||||||
|
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
|
@ -1,52 +0,0 @@
|
||||||
# -*- encoding : utf-8 -*-
|
|
||||||
class RegisterRequestsController < ApplicationController
|
|
||||||
load_and_authorize_resource
|
|
||||||
|
|
||||||
before_filter :find_register_request, :only => [:approve, :reject]
|
|
||||||
|
|
||||||
def index
|
|
||||||
@register_requests = @register_requests.send((params[:scope] || 'unprocessed').to_sym).paginate(:page => params[:page])
|
|
||||||
end
|
|
||||||
|
|
||||||
def new
|
|
||||||
# render :layout => 'sessions'
|
|
||||||
redirect_to '/invite.html'
|
|
||||||
end
|
|
||||||
|
|
||||||
def show_message
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
RegisterRequest.create(params[:register_request])
|
|
||||||
redirect_to '/thanks.html' #show_message_register_requests_path
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
if params[:update_type].present? and params[:request_ids].present?
|
|
||||||
updates = RegisterRequest.where(:id => params[:request_ids])
|
|
||||||
case params[:update_type]
|
|
||||||
when 'approve' # see approve method
|
|
||||||
updates.each {|req| req.update_attributes(:approved => true, :rejected => false)}
|
|
||||||
when 'reject' # see reject method
|
|
||||||
updates.each {|req| req.update_attributes(:approved => false, :rejected => true)}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
redirect_to :action => :index
|
|
||||||
end
|
|
||||||
|
|
||||||
def approve
|
|
||||||
@register_request.update_attributes(:approved => true, :rejected => false)
|
|
||||||
redirect_to :action => :index
|
|
||||||
end
|
|
||||||
|
|
||||||
def reject
|
|
||||||
@register_request.update_attributes(:approved => false, :rejected => true)
|
|
||||||
redirect_to :action => :index
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def find_register_request
|
|
||||||
@register_request = RegisterRequest.find(params[:register_request_id])
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,21 +0,0 @@
|
||||||
# -*- encoding : utf-8 -*-
|
|
||||||
class Settings::NotifiersController < ApplicationController
|
|
||||||
before_filter :authenticate_user!
|
|
||||||
|
|
||||||
load_and_authorize_resource :user
|
|
||||||
load_and_authorize_resource :class => Settings::Notifier, :through => :user, :singleton => true, :shallow => true
|
|
||||||
|
|
||||||
def show
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
if @notifier.update_attributes(params[:settings_notifier])
|
|
||||||
flash[:notice] = I18n.t("flash.settings.saved")
|
|
||||||
redirect_to user_settings_notifier_path(@user)
|
|
||||||
else
|
|
||||||
flash[:notice] = I18n.t("flash.settings.save_error")
|
|
||||||
redirect_to user_settings_notifier_path(@user)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Users::BaseController < ApplicationController
|
||||||
|
before_filter :authenticate_user!
|
||||||
|
before_filter :find_user
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def find_user
|
||||||
|
if user_id = params[:owner_name] || params[:user_id] || params[:id]
|
||||||
|
@user = User.find_by_insensitive_uname! user_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,10 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Users::ProfileController < Users::BaseController
|
||||||
|
autocomplete :user, :uname
|
||||||
|
|
||||||
|
def show
|
||||||
|
@groups = @user.groups.uniq
|
||||||
|
@platforms = @user.platforms.paginate(:page => params[:platform_page], :per_page => 10)
|
||||||
|
@projects = @user.projects.paginate(:page => params[:project_page], :per_page => 10)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,11 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Users::RegisterRequestsController < ApplicationController
|
||||||
|
def new
|
||||||
|
redirect_to '/invite.html'
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
RegisterRequest.create(params[:register_request])
|
||||||
|
redirect_to '/thanks.html'
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,55 @@
|
||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
class Users::SettingsController < Users::BaseController
|
||||||
|
before_filter :set_current_user
|
||||||
|
|
||||||
|
def profile
|
||||||
|
if request.put?
|
||||||
|
send_confirmation = params[:user][:email] != @user.email
|
||||||
|
if @user.update_without_password(params[:user])
|
||||||
|
if @user.avatar && params[:delete_avatar] == '1'
|
||||||
|
@user.avatar = nil
|
||||||
|
@user.save
|
||||||
|
end
|
||||||
|
if send_confirmation
|
||||||
|
@user.confirmed_at, @user.confirmation_sent_at = nil
|
||||||
|
@user.send_confirmation_instructions
|
||||||
|
end
|
||||||
|
flash[:notice] = t('flash.user.saved')
|
||||||
|
redirect_to profile_settings_path
|
||||||
|
else
|
||||||
|
flash[:error] = t('flash.user.save_error')
|
||||||
|
flash[:warning] = @user.errors.full_messages.join('. ')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def private
|
||||||
|
if request.put?
|
||||||
|
if @user.update_with_password(params[:user])
|
||||||
|
flash[:notice] = t('flash.user.saved')
|
||||||
|
redirect_to private_settings_path
|
||||||
|
else
|
||||||
|
flash[:error] = t('flash.user.save_error')
|
||||||
|
flash[:warning] = @user.errors.full_messages.join('. ')
|
||||||
|
render(:action => :private)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def notifiers
|
||||||
|
if request.put?
|
||||||
|
if @user.notifier.update_attributes(params[:settings_notifier])
|
||||||
|
flash[:notice] = I18n.t("flash.settings.saved")
|
||||||
|
redirect_to notifiers_settings_path
|
||||||
|
else
|
||||||
|
flash[:error] = I18n.t("flash.settings.save_error")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def set_current_user
|
||||||
|
@user = current_user
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,57 +0,0 @@
|
||||||
# -*- encoding : utf-8 -*-
|
|
||||||
class UsersController < ApplicationController
|
|
||||||
before_filter :authenticate_user!
|
|
||||||
|
|
||||||
load_and_authorize_resource :only => :show
|
|
||||||
before_filter :set_current_user, :only => [:profile, :update, :private]
|
|
||||||
autocomplete :user, :uname
|
|
||||||
|
|
||||||
def show
|
|
||||||
@groups = @user.groups.uniq
|
|
||||||
@platforms = @user.platforms.paginate(:page => params[:platform_page], :per_page => 10)
|
|
||||||
@projects = @user.projects.paginate(:page => params[:project_page], :per_page => 10)
|
|
||||||
end
|
|
||||||
|
|
||||||
def profile
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
send_confirmation = params[:user][:email] != @user.email
|
|
||||||
if @user.update_without_password(params[:user])
|
|
||||||
if @user.avatar && params[:delete_avatar] == '1'
|
|
||||||
@user.avatar = nil
|
|
||||||
@user.save
|
|
||||||
end
|
|
||||||
if send_confirmation
|
|
||||||
@user.confirmed_at, @user.confirmation_sent_at = nil
|
|
||||||
@user.send_confirmation_instructions
|
|
||||||
end
|
|
||||||
flash[:notice] = t('flash.user.saved')
|
|
||||||
redirect_to edit_profile_path
|
|
||||||
else
|
|
||||||
flash[:error] = t('flash.user.save_error')
|
|
||||||
flash[:warning] = @user.errors.full_messages.join('. ')
|
|
||||||
render(:action => :profile)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def private
|
|
||||||
if request.put?
|
|
||||||
if @user.update_with_password(params[:user])
|
|
||||||
flash[:notice] = t('flash.user.saved')
|
|
||||||
redirect_to user_private_settings_path(@user)
|
|
||||||
else
|
|
||||||
flash[:error] = t('flash.user.save_error')
|
|
||||||
flash[:warning] = @user.errors.full_messages.join('. ')
|
|
||||||
render(:action => :private)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def set_current_user
|
|
||||||
@user = current_user
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
module ActivityFeedsHelper
|
module ActivityFeedsHelper
|
||||||
def render_activity_feed(activity_feed)
|
def render_activity_feed(activity_feed)
|
||||||
render :partial => activity_feed.partial, :locals => activity_feed.data.merge(:activity_feed => activity_feed)
|
render activity_feed.partial, activity_feed.data.merge(:activity_feed => activity_feed)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_feed_title_from_content(content)
|
def get_feed_title_from_content(content)
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
def layout_class
|
def layout_class
|
||||||
case
|
case
|
||||||
when params[:controller] == 'issues' && params[:action] == 'new'
|
when controller_name == 'issues' && action_name == 'new'
|
||||||
'right nopadding'
|
'right nopadding'
|
||||||
when params[:controller] == 'build_lists' && params[:action] == 'index'
|
when controller_name == 'build_lists' && action_name == 'index'
|
||||||
'right slim'
|
'right slim'
|
||||||
when params[:controller] == 'build_lists' && ['new', 'create'].include?(params[:action])
|
when controller_name == 'build_lists' && ['new', 'create'].include?(action_name)
|
||||||
nil
|
nil
|
||||||
when params[:controller] == 'platforms' && params[:action] == 'show'
|
when controller_name == 'platforms' && action_name == 'show'
|
||||||
'right bigpadding'
|
'right bigpadding'
|
||||||
when params[:controller] == 'platforms' && params[:action] == 'clone'
|
when controller_name == 'platforms' && action_name == 'clone'
|
||||||
'right middlepadding'
|
'right middlepadding'
|
||||||
else
|
else
|
||||||
content_for?(:sidebar) ? 'right' : 'all'
|
content_for?(:sidebar) ? 'right' : 'all'
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
# -*- encoding : utf-8 -*-
|
|
||||||
module Settings::NotifiersHelper
|
|
||||||
end
|
|
|
@ -1,3 +0,0 @@
|
||||||
# -*- encoding : utf-8 -*-
|
|
||||||
module SubscribesHelper
|
|
||||||
end
|
|
|
@ -23,12 +23,11 @@ class Ability
|
||||||
can [:publish_build, :status_build, :pre_build, :post_build, :circle_build, :new_bbdt], BuildList
|
can [:publish_build, :status_build, :pre_build, :post_build, :circle_build, :new_bbdt], BuildList
|
||||||
|
|
||||||
if user.guest? # Guest rights
|
if user.guest? # Guest rights
|
||||||
can [:create, :show_message], RegisterRequest
|
# can [:new, :create], RegisterRequest
|
||||||
else # Registered user rights
|
else # Registered user rights
|
||||||
if user.admin?
|
if user.admin?
|
||||||
can :manage, :all
|
can :manage, :all
|
||||||
# Protection
|
# Protection
|
||||||
cannot :create, RegisterRequest
|
|
||||||
cannot :approve, RegisterRequest, :approved => true
|
cannot :approve, RegisterRequest, :approved => true
|
||||||
cannot :reject, RegisterRequest, :rejected => true
|
cannot :reject, RegisterRequest, :rejected => true
|
||||||
cannot [:destroy, :create], Subscribe
|
cannot [:destroy, :create], Subscribe
|
||||||
|
@ -40,15 +39,13 @@ class Ability
|
||||||
|
|
||||||
if user.user?
|
if user.user?
|
||||||
can [:show, :autocomplete_user_uname], User
|
can [:show, :autocomplete_user_uname], User
|
||||||
can [:profile, :update, :private], User, :id => user.id
|
|
||||||
|
|
||||||
can [:show, :update], Settings::Notifier, :user_id => user.id
|
|
||||||
|
|
||||||
can [:read, :create, :autocomplete_group_uname], Group
|
can [:read, :create, :autocomplete_group_uname], Group
|
||||||
can [:update, :manage_members], Group do |group|
|
can [:update, :manage_members], Group do |group|
|
||||||
group.actors.exists?(:actor_type => 'User', :actor_id => user.id, :role => 'admin') # or group.owner_id = user.id
|
group.actors.exists?(:actor_type => 'User', :actor_id => user.id, :role => 'admin') # or group.owner_id = user.id
|
||||||
end
|
end
|
||||||
can :destroy, Group, :owner_id => user.id
|
can :destroy, Group, :owner_id => user.id
|
||||||
|
can :remove_user, Group
|
||||||
|
|
||||||
can :create, Project
|
can :create, Project
|
||||||
can :read, Project, :visibility => 'open'
|
can :read, Project, :visibility => 'open'
|
||||||
|
@ -58,7 +55,7 @@ class Ability
|
||||||
can(:write, Project) {|project| local_writer? project} # for grack
|
can(:write, Project) {|project| local_writer? project} # for grack
|
||||||
can([:update, :sections, :manage_collaborators], Project) {|project| local_admin? project}
|
can([:update, :sections, :manage_collaborators], Project) {|project| local_admin? project}
|
||||||
can(:fork, Project) {|project| can? :read, project}
|
can(:fork, Project) {|project| can? :read, project}
|
||||||
can(:fork_to_group, Project) {|project| project.owner_type == 'Group' and can? :update, project.owner}
|
can(:fork, Project) {|project| project.owner_type == 'Group' and can? :update, project.owner}
|
||||||
can(:destroy, Project) {|project| owner? project}
|
can(:destroy, Project) {|project| owner? project}
|
||||||
can(:destroy, Project) {|project| project.owner_type == 'Group' and project.owner.actors.exists?(:actor_type => 'User', :actor_id => user.id, :role => 'admin')}
|
can(:destroy, Project) {|project| project.owner_type == 'Group' and project.owner.actors.exists?(:actor_type => 'User', :actor_id => user.id, :role => 'admin')}
|
||||||
can :remove_user, Project
|
can :remove_user, Project
|
||||||
|
@ -118,13 +115,10 @@ class Ability
|
||||||
# Shared cannot rights for all users (registered, admin)
|
# Shared cannot rights for all users (registered, admin)
|
||||||
cannot :destroy, Platform, :platform_type => 'personal'
|
cannot :destroy, Platform, :platform_type => 'personal'
|
||||||
cannot [:create, :destroy, :add_project, :remove_project], Repository, :platform => {:platform_type => 'personal'}
|
cannot [:create, :destroy, :add_project, :remove_project], Repository, :platform => {:platform_type => 'personal'}
|
||||||
cannot :fork, Project, :owner_id => user.id, :owner_type => user.class.to_s
|
|
||||||
cannot :destroy, Issue
|
cannot :destroy, Issue
|
||||||
|
|
||||||
cannot [:members, :add_member, :remove_member, :remove_members], Platform, :platform_type => 'personal'
|
cannot [:members, :add_member, :remove_member, :remove_members], Platform, :platform_type => 'personal'
|
||||||
|
|
||||||
# cannot :read, Product, :platform => {:platform_type => 'personal'}
|
|
||||||
# cannot(:read, Product, read_relations_for('products', 'platforms')) {|product| product.platform.platform_type == 'personal'}
|
|
||||||
cannot [:create, :update, :destroy, :clone], Product, :platform => {:platform_type => 'personal'}
|
cannot [:create, :update, :destroy, :clone], Product, :platform => {:platform_type => 'personal'}
|
||||||
cannot [:clone, :build_all], Platform, :platform_type => 'personal'
|
cannot [:clone, :build_all], Platform, :platform_type => 'personal'
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
class Group < ActiveRecord::Base
|
class Group < ActiveRecord::Base
|
||||||
belongs_to :owner, :class_name => 'User'
|
belongs_to :owner, :class_name => 'User'
|
||||||
|
|
||||||
has_many :relations, :as => :actor, :dependent => :destroy
|
has_many :relations, :as => :actor, :dependent => :destroy, :dependent => :destroy
|
||||||
has_many :actors, :as => :target, :class_name => 'Relation'
|
has_many :actors, :as => :target, :class_name => 'Relation', :dependent => :destroy
|
||||||
has_many :targets, :as => :actor, :class_name => 'Relation'
|
has_many :targets, :as => :actor, :class_name => 'Relation', :dependent => :destroy
|
||||||
|
|
||||||
has_many :members, :through => :actors, :source => :actor, :source_type => 'User', :autosave => true
|
has_many :members, :through => :actors, :source => :actor, :source_type => 'User', :autosave => true
|
||||||
has_many :projects, :through => :targets, :source => :target, :source_type => 'Project', :autosave => true
|
has_many :projects, :through => :targets, :source => :target, :source_type => 'Project', :autosave => true
|
||||||
|
@ -13,22 +13,21 @@ class Group < ActiveRecord::Base
|
||||||
has_many :own_platforms, :as => :owner, :class_name => 'Platform', :dependent => :destroy
|
has_many :own_platforms, :as => :owner, :class_name => 'Platform', :dependent => :destroy
|
||||||
|
|
||||||
validates :owner, :presence => true
|
validates :owner, :presence => true
|
||||||
validates :uname, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /^[a-z0-9_]+$/ }
|
validates :uname, :presence => true, :uniqueness => {:case_sensitive => false}, :format => {:with => /^[a-z0-9_]+$/}, :reserved_name => true
|
||||||
validate { errors.add(:uname, :taken) if User.where('uname LIKE ?', uname).present? }
|
validate { errors.add(:uname, :taken) if User.by_uname(uname).present? }
|
||||||
|
|
||||||
scope :opened, where('1=1')
|
scope :opened, where('1=1')
|
||||||
scope :by_owner, lambda {|owner| where(:owner_id => owner.id)}
|
scope :by_owner, lambda {|owner| where(:owner_id => owner.id)}
|
||||||
scope :by_admin, lambda {|admin| joins(:actors).where(:'relations.role' => 'admin', :'relations.actor_id' => admin.id, :'relations.actor_type' => 'User')}
|
scope :by_admin, lambda {|admin| joins(:actors).where(:'relations.role' => 'admin', :'relations.actor_id' => admin.id, :'relations.actor_type' => 'User')}
|
||||||
|
|
||||||
include Modules::Models::ActsLikeMember
|
attr_accessible :uname, :description
|
||||||
|
attr_readonly :uname
|
||||||
attr_accessible :description
|
|
||||||
attr_readonly :own_projects_count
|
|
||||||
|
|
||||||
delegate :email, :to => :owner
|
delegate :email, :to => :owner
|
||||||
|
|
||||||
after_create :add_owner_to_members
|
after_create :add_owner_to_members
|
||||||
|
|
||||||
|
include Modules::Models::ActsLikeMember
|
||||||
include Modules::Models::PersonalRepository
|
include Modules::Models::PersonalRepository
|
||||||
# include Modules::Models::Owner
|
# include Modules::Models::Owner
|
||||||
|
|
||||||
|
@ -43,7 +42,6 @@ class Group < ActiveRecord::Base
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def add_owner_to_members
|
def add_owner_to_members
|
||||||
Relation.create_with_role(self.owner, self, 'admin')
|
Relation.create_with_role(self.owner, self, 'admin') # members << self.owner if !members.exists?(:id => self.owner.id)
|
||||||
# members << self.owner if !members.exists?(:id => self.owner.id)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,8 +9,8 @@ class Issue < ActiveRecord::Base
|
||||||
|
|
||||||
has_many :comments, :as => :commentable, :dependent => :destroy
|
has_many :comments, :as => :commentable, :dependent => :destroy
|
||||||
has_many :subscribes, :as => :subscribeable, :dependent => :destroy
|
has_many :subscribes, :as => :subscribeable, :dependent => :destroy
|
||||||
|
has_many :labelings, :dependent => :destroy
|
||||||
has_many :labels, :through => :labelings, :uniq => true
|
has_many :labels, :through => :labelings, :uniq => true
|
||||||
has_many :labelings
|
|
||||||
|
|
||||||
validates :title, :body, :project_id, :presence => true
|
validates :title, :body, :project_id, :presence => true
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ class Label < ActiveRecord::Base
|
||||||
has_many :issues, :through => :labelings
|
has_many :issues, :through => :labelings
|
||||||
belongs_to :project
|
belongs_to :project
|
||||||
|
|
||||||
validates :name, :uniqueness => { :scope => :project_id}
|
validates :name, :uniqueness => {:scope => :project_id}
|
||||||
validates :name, :color, :presence => true
|
validates :name, :color, :presence => true
|
||||||
validates :color, :format => { :with => /\A([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/, :message => I18n.t('layout.issues.invalid_labels')}
|
validates :color, :format => { :with => /\A([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/, :message => I18n.t('layout.issues.invalid_labels')}
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,7 @@ class Platform < ActiveRecord::Base
|
||||||
scope :main, where(:platform_type => 'main')
|
scope :main, where(:platform_type => 'main')
|
||||||
scope :personal, where(:platform_type => 'personal')
|
scope :personal, where(:platform_type => 'personal')
|
||||||
|
|
||||||
attr_accessible :owner, :visibility, :description, :released #, :owner_id, :owner_type
|
attr_accessible :name, :distrib_type, :parent_platform_id, :platform_type, :owner, :visibility, :description, :released
|
||||||
|
|
||||||
attr_accessible :name, :distrib_type, :parent_platform_id, :platform_type
|
|
||||||
attr_readonly :name, :distrib_type, :parent_platform_id, :platform_type
|
attr_readonly :name, :distrib_type, :parent_platform_id, :platform_type
|
||||||
|
|
||||||
include Modules::Models::Owner
|
include Modules::Models::Owner
|
||||||
|
@ -100,7 +98,8 @@ class Platform < ActiveRecord::Base
|
||||||
|
|
||||||
def base_clone(attrs = {}) # :description, :name, :owner
|
def base_clone(attrs = {}) # :description, :name, :owner
|
||||||
clone.tap do |c|
|
clone.tap do |c|
|
||||||
c.attributes = attrs # attrs.each {|k,v| c.send("#{k}=", v)}
|
# c.attributes = attrs #
|
||||||
|
attrs.each {|k,v| c.send("#{k}=", v)}
|
||||||
c.updated_at = nil; c.created_at = nil # :id = nil
|
c.updated_at = nil; c.created_at = nil # :id = nil
|
||||||
c.parent = self
|
c.parent = self
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,8 +15,7 @@ class Product < ActiveRecord::Base
|
||||||
|
|
||||||
scope :recent, order("name ASC")
|
scope :recent, order("name ASC")
|
||||||
|
|
||||||
attr_accessible :name, :counter, :ks, :menu, :tar, :cron_tab, :use_cron
|
attr_accessible :name, :counter, :ks, :menu, :tar, :cron_tab, :use_cron, :description, :build_script, :delete_tar
|
||||||
attr_accessible :description, :build_script, :delete_tar
|
|
||||||
attr_readonly :platform_id
|
attr_readonly :platform_id
|
||||||
|
|
||||||
def delete_tar
|
def delete_tar
|
||||||
|
|
|
@ -7,6 +7,7 @@ class Project < ActiveRecord::Base
|
||||||
|
|
||||||
has_many :issues, :dependent => :destroy
|
has_many :issues, :dependent => :destroy
|
||||||
has_many :pull_requests, :dependent => :destroy, :foreign_key => 'base_project_id'
|
has_many :pull_requests, :dependent => :destroy, :foreign_key => 'base_project_id'
|
||||||
|
has_many :labels, :dependent => :destroy
|
||||||
has_many :build_lists, :dependent => :destroy
|
has_many :build_lists, :dependent => :destroy
|
||||||
|
|
||||||
has_many :project_imports, :dependent => :destroy
|
has_many :project_imports, :dependent => :destroy
|
||||||
|
@ -16,7 +17,6 @@ class Project < ActiveRecord::Base
|
||||||
has_many :relations, :as => :target, :dependent => :destroy
|
has_many :relations, :as => :target, :dependent => :destroy
|
||||||
has_many :collaborators, :through => :relations, :source => :actor, :source_type => 'User'
|
has_many :collaborators, :through => :relations, :source => :actor, :source_type => 'User'
|
||||||
has_many :groups, :through => :relations, :source => :actor, :source_type => 'Group'
|
has_many :groups, :through => :relations, :source => :actor, :source_type => 'Group'
|
||||||
has_many :labels
|
|
||||||
|
|
||||||
validates :name, :uniqueness => {:scope => [:owner_id, :owner_type], :case_sensitive => false}, :presence => true, :format => {:with => /^[a-zA-Z0-9_\-\+\.]+$/}
|
validates :name, :uniqueness => {:scope => [:owner_id, :owner_type], :case_sensitive => false}, :presence => true, :format => {:with => /^[a-zA-Z0-9_\-\+\.]+$/}
|
||||||
validates :owner, :presence => true
|
validates :owner, :presence => true
|
||||||
|
@ -52,6 +52,21 @@ class Project < ActiveRecord::Base
|
||||||
|
|
||||||
include Modules::Models::Owner
|
include Modules::Models::Owner
|
||||||
|
|
||||||
|
def to_param
|
||||||
|
name
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.find_by_owner_and_name(owner_name, project_name)
|
||||||
|
owner = User.find_by_uname(owner_name) || Group.find_by_uname(owner_name) || User.by_uname(owner_name).first || Group.by_uname(owner_name).first and
|
||||||
|
scoped = where(:owner_id => owner.id, :owner_type => owner.class) and
|
||||||
|
scoped.find_by_name(project_name) || scoped.by_name(project_name).first
|
||||||
|
# owner.projects.find_by_name(project_name) || owner.projects.by_name(project_name).first # TODO force this work?
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.find_by_owner_and_name!(owner_name, project_name)
|
||||||
|
find_by_owner_and_name(owner_name, project_name) or raise ActiveRecord::RecordNotFound
|
||||||
|
end
|
||||||
|
|
||||||
def build_for(platform, user, arch = 'i586', priority = 0)
|
def build_for(platform, user, arch = 'i586', priority = 0)
|
||||||
# Select main and project platform repository(contrib, non-free and etc)
|
# Select main and project platform repository(contrib, non-free and etc)
|
||||||
# If main does not exist, will connect only project platform repository
|
# If main does not exist, will connect only project platform repository
|
||||||
|
@ -258,7 +273,7 @@ class Project < ActiveRecord::Base
|
||||||
def create_wiki
|
def create_wiki
|
||||||
if has_wiki && !FileTest.exist?(wiki_path)
|
if has_wiki && !FileTest.exist?(wiki_path)
|
||||||
Grit::Repo.init_bare(wiki_path)
|
Grit::Repo.init_bare(wiki_path)
|
||||||
wiki = Gollum::Wiki.new(wiki_path, {:base_path => Rails.application.routes.url_helpers.project_wiki_index_path(self)})
|
wiki = Gollum::Wiki.new(wiki_path, {:base_path => Rails.application.routes.url_helpers.project_wiki_index_path(owner, self)})
|
||||||
wiki.write_page('Home', :markdown, I18n.t("wiki.seed.welcome_content"),
|
wiki.write_page('Home', :markdown, I18n.t("wiki.seed.welcome_content"),
|
||||||
{:name => owner.name, :email => owner.email, :message => 'Initial commit'})
|
{:name => owner.name, :email => owner.email, :message => 'Initial commit'})
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,6 +11,14 @@ class RegisterRequest < ActiveRecord::Base
|
||||||
|
|
||||||
validates :email, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i }
|
validates :email, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i }
|
||||||
|
|
||||||
|
def approve
|
||||||
|
update_attributes(:approved => true, :rejected => false)
|
||||||
|
end
|
||||||
|
|
||||||
|
def reject
|
||||||
|
update_attributes(:approved => false, :rejected => true)
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def generate_token
|
def generate_token
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
# -*- encoding : utf-8 -*-
|
|
||||||
module Settings
|
|
||||||
def self.table_name_prefix
|
|
||||||
'settings_'
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class Settings::Notifier < ActiveRecord::Base
|
class SettingsNotifier < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
validates :user_id, :presence => true
|
validates :user_id, :presence => true
|
|
@ -15,7 +15,7 @@ class User < ActiveRecord::Base
|
||||||
}
|
}
|
||||||
validates_inclusion_of :avatar_file_size, :in => (0..MAX_AVATAR_SIZE), :allow_nil => true
|
validates_inclusion_of :avatar_file_size, :in => (0..MAX_AVATAR_SIZE), :allow_nil => true
|
||||||
|
|
||||||
has_one :notifier, :class_name => 'Settings::Notifier', :dependent => :destroy #:notifier
|
has_one :notifier, :class_name => 'SettingsNotifier', :dependent => :destroy #:notifier
|
||||||
|
|
||||||
has_many :activity_feeds, :dependent => :destroy
|
has_many :activity_feeds, :dependent => :destroy
|
||||||
|
|
||||||
|
@ -35,16 +35,14 @@ class User < ActiveRecord::Base
|
||||||
has_many :own_groups, :foreign_key => :owner_id, :class_name => 'Group', :dependent => :destroy
|
has_many :own_groups, :foreign_key => :owner_id, :class_name => 'Group', :dependent => :destroy
|
||||||
has_many :own_platforms, :as => :owner, :class_name => 'Platform', :dependent => :destroy
|
has_many :own_platforms, :as => :owner, :class_name => 'Platform', :dependent => :destroy
|
||||||
|
|
||||||
include Modules::Models::PersonalRepository
|
validates :uname, :presence => true, :uniqueness => {:case_sensitive => false}, :format => {:with => /^[a-z0-9_]+$/}, :reserved_name => true
|
||||||
|
validate { errors.add(:uname, :taken) if Group.by_uname(uname).present? }
|
||||||
validates :uname, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /^[a-z0-9_]+$/ }
|
|
||||||
validate { errors.add(:uname, :taken) if Group.where('uname LIKE ?', uname).present? }
|
|
||||||
validates :role, :inclusion => {:in => ROLES}, :allow_blank => true
|
validates :role, :inclusion => {:in => ROLES}, :allow_blank => true
|
||||||
validates :language, :inclusion => {:in => LANGUAGES}, :allow_blank => true
|
validates :language, :inclusion => {:in => LANGUAGES}, :allow_blank => true
|
||||||
|
|
||||||
attr_accessible :email, :password, :password_confirmation, :current_password, :remember_me, :login, :name, :uname, :language,
|
attr_accessible :email, :password, :password_confirmation, :current_password, :remember_me, :login, :name, :uname, :language,
|
||||||
:site, :company, :professional_experience, :location, :avatar
|
:site, :company, :professional_experience, :location, :avatar
|
||||||
attr_readonly :uname, :own_projects_count
|
attr_readonly :uname
|
||||||
attr_accessor :login
|
attr_accessor :login
|
||||||
|
|
||||||
scope :opened, where('1=1')
|
scope :opened, where('1=1')
|
||||||
|
@ -52,11 +50,12 @@ class User < ActiveRecord::Base
|
||||||
scope :admin, where(:role => 'admin')
|
scope :admin, where(:role => 'admin')
|
||||||
scope :real, where(:role => ['', nil])
|
scope :real, where(:role => ['', nil])
|
||||||
|
|
||||||
include Modules::Models::ActsLikeMember
|
|
||||||
|
|
||||||
after_create lambda { self.create_notifier }
|
after_create lambda { self.create_notifier }
|
||||||
before_create :ensure_authentication_token
|
before_create :ensure_authentication_token
|
||||||
|
|
||||||
|
include Modules::Models::PersonalRepository
|
||||||
|
include Modules::Models::ActsLikeMember
|
||||||
|
|
||||||
def admin?
|
def admin?
|
||||||
role == 'admin'
|
role == 'admin'
|
||||||
end
|
end
|
||||||
|
@ -77,6 +76,10 @@ class User < ActiveRecord::Base
|
||||||
return "#{uname} (#{name})"
|
return "#{uname} (#{name})"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_appeal
|
||||||
|
name.presence || uname
|
||||||
|
end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def find_for_database_authentication(warden_conditions)
|
def find_for_database_authentication(warden_conditions)
|
||||||
conditions = warden_conditions.dup
|
conditions = warden_conditions.dup
|
||||||
|
@ -126,14 +129,4 @@ class User < ActiveRecord::Base
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_appeal
|
|
||||||
name.blank? ? uname : name
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def create_settings_notifier
|
|
||||||
self.create_notifier
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
.text
|
.text
|
||||||
%span
|
%span
|
||||||
= raw t('notifications.bodies.build_task', :task_num => task_num, :task_link => build_list_path(build_list_id))
|
= raw t('notifications.bodies.build_task', :task_num => task_num, :task_link => build_list_path(build_list_id))
|
||||||
= raw t('notifications.bodies.project', :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
|
= raw t('notifications.bodies.project', :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) )
|
||||||
- message, error = case status
|
- message, error = case status
|
||||||
- when BuildList::BUILD_PENDING
|
- when BuildList::BUILD_PENDING
|
||||||
- ['pending', nil]
|
- ['pending', nil]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.text
|
.text
|
||||||
%span
|
%span
|
||||||
= t('notifications.bodies.delete_branch', :branch_name => branch_name)
|
= t('notifications.bodies.delete_branch', :branch_name => branch_name)
|
||||||
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
|
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) )
|
||||||
.both
|
.both
|
||||||
%span.date= activity_feed.created_at
|
%span.date= activity_feed.created_at
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
.text
|
.text
|
||||||
%span
|
%span
|
||||||
= raw t("notifications.bodies.#{change_type}_branch", {:branch_name => branch_name, :user_link => defined?(user_name) ? link_to(user_name, user_path(user_id)) : user_email})
|
= raw t("notifications.bodies.#{change_type}_branch", {:branch_name => branch_name, :user_link => defined?(user_name) ? link_to(user_name, user_path(user_id)) : user_email})
|
||||||
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
|
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) )
|
||||||
.both
|
.both
|
||||||
%span.date= activity_feed.created_at
|
%span.date= activity_feed.created_at
|
||||||
.both
|
.both
|
||||||
%span.subject
|
%span.subject
|
||||||
- last_commits.each do |commit|
|
- last_commits.each do |commit|
|
||||||
= link_to shortest_hash_id(commit[0]), commit_path(project_id, commit[0])
|
= link_to shortest_hash_id(commit[0]), commit_path(project_owner, project_name, commit[0])
|
||||||
= commit[1]
|
= commit[1]
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
.top
|
.top
|
||||||
.text
|
.text
|
||||||
%span
|
%span
|
||||||
= raw t("notifications.bodies.issue_assign_notification", { :issue_link => link_to(issue_title, project_issue_path(project_id, issue_serial_id))})
|
= raw t("notifications.bodies.issue_assign_notification", { :issue_link => link_to(issue_title, project_issue_path(project_owner, project_name, issue_serial_id))})
|
||||||
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
|
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) )
|
||||||
.both
|
.both
|
||||||
%span.date= activity_feed.created_at
|
%span.date= activity_feed.created_at
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
.text
|
.text
|
||||||
%span
|
%span
|
||||||
= raw t("notifications.bodies.new_comment_notification.title", :user_link => link_to(user_name, user_path(user_id)) )
|
= raw t("notifications.bodies.new_comment_notification.title", :user_link => link_to(user_name, user_path(user_id)) )
|
||||||
= raw t("notifications.bodies.new_comment_notification.commit_content", {:commit_link => link_to(commit_message, commit_path(project_id, commit_id) + "#comment##{comment_id}")})
|
= raw t("notifications.bodies.new_comment_notification.commit_content", {:commit_link => link_to(commit_message, commit_path(project_owner, project_name, commit_id) + "#comment##{comment_id}")})
|
||||||
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
|
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) )
|
||||||
.both
|
.both
|
||||||
%span.date= activity_feed.created_at
|
%span.date= activity_feed.created_at
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
.text
|
.text
|
||||||
%span
|
%span
|
||||||
= raw t("notifications.bodies.new_comment_notification.title", {:user_link => link_to(user_name, user_path(user_id))})
|
= raw t("notifications.bodies.new_comment_notification.title", {:user_link => link_to(user_name, user_path(user_id))})
|
||||||
= raw t("notifications.bodies.new_comment_notification.content", {:issue_link => link_to(issue_title, project_issue_path(project_id, issue_serial_id) + "#comment##{comment_id}")})
|
= raw t("notifications.bodies.new_comment_notification.content", {:issue_link => link_to(issue_title, project_issue_path(project_owner, project_name, issue_serial_id) + "#comment##{comment_id}")})
|
||||||
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
|
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) )
|
||||||
.both
|
.both
|
||||||
%span.date= activity_feed.created_at
|
%span.date= activity_feed.created_at
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
|
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
|
||||||
.text
|
.text
|
||||||
%span
|
%span
|
||||||
= raw t("notifications.bodies.new_issue_notification", { :user_link => link_to(user_name, user_path(user_id)), :issue_link => project_issue_path(project_id, issue_serial_id)})
|
= raw t("notifications.bodies.new_issue_notification", { :user_link => link_to(user_name, user_path(user_id)), :issue_link => project_issue_path(project_owner, project_name, issue_serial_id)})
|
||||||
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
|
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) )
|
||||||
.both
|
.both
|
||||||
%span.date= activity_feed.created_at
|
%span.date= activity_feed.created_at
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
|
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
|
||||||
.text
|
.text
|
||||||
%span
|
%span
|
||||||
= raw t("notifications.bodies.wiki_new_commit_notification", {:user_link => user_name, :history_link => link_to("wiki", history_project_wiki_index_path(project_id))})
|
= raw t("notifications.bodies.wiki_new_commit_notification", {:user_link => user_name, :history_link => link_to("wiki", history_project_wiki_index_path(project_owner, project_name))})
|
||||||
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
|
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) )
|
||||||
.both
|
.both
|
||||||
%span.date= activity_feed.created_at
|
%span.date= activity_feed.created_at
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
- content_for :submenu do
|
|
||||||
%nav
|
|
||||||
= render :partial => 'layouts/menu/top', :locals => {:which_menu => 'admins_menu'}
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
- content_for :submenu do
|
||||||
|
%nav= render 'layouts/menu/top', :which_menu => 'admins_menu'
|
|
@ -0,0 +1,14 @@
|
||||||
|
%h3.fix= title t("layout.event_logs.list_header")
|
||||||
|
|
||||||
|
%table#datatable.tablesorter.list-users
|
||||||
|
%tr
|
||||||
|
%th.first= t("activerecord.attributes.event_log.kind")
|
||||||
|
%th= t("activerecord.attributes.event_log.created_at")
|
||||||
|
%th= t("activerecord.attributes.event_log.user")
|
||||||
|
%th= t("activerecord.attributes.event_log.ip")
|
||||||
|
%th= t("activerecord.attributes.event_log.protocol")
|
||||||
|
%th.last= t("activerecord.attributes.event_log.description")
|
||||||
|
= render @event_logs
|
||||||
|
= will_paginate
|
||||||
|
|
||||||
|
= render 'submenu'
|
|
@ -0,0 +1,55 @@
|
||||||
|
%div{:style => 'float: right; margin: 20px'}
|
||||||
|
= link_to t("layout.register_request.approved"), admin_register_requests_path(:scope => :approved)
|
||||||
|
\|
|
||||||
|
= link_to t("layout.register_request.rejected"), admin_register_requests_path(:scope => :rejected)
|
||||||
|
%h2.title= title t("layout.register_request.list_header")
|
||||||
|
= form_tag admin_register_requests_path, :method => :put, :class => 'update_form' do
|
||||||
|
= hidden_field_tag 'update_type'
|
||||||
|
%table.tablesorter
|
||||||
|
%tr
|
||||||
|
%th
|
||||||
|
%th= t("activerecord.attributes.register_request.name")
|
||||||
|
%th= t("activerecord.attributes.register_request.email")
|
||||||
|
%th= t("activerecord.attributes.register_request.interest")
|
||||||
|
%th= t("activerecord.attributes.register_request.more")
|
||||||
|
%th= t("activerecord.attributes.register_request.created_at")
|
||||||
|
%th
|
||||||
|
- @register_requests.each do |request|
|
||||||
|
%tr{:class => cycle("odd", "even")}
|
||||||
|
%td= check_box_tag 'request_ids[]', request.id
|
||||||
|
%td= request.name
|
||||||
|
- @user = User.find_by_email(request.email) if request.approved
|
||||||
|
%td= link_to_if @user, request.email, @user
|
||||||
|
%td= request.interest
|
||||||
|
%td= request.more
|
||||||
|
%td= request.created_at
|
||||||
|
%td
|
||||||
|
= link_to t("layout.approve"), approve_admin_register_request_path(request) if can? :approve, request
|
||||||
|
|
|
||||||
|
= link_to t("layout.reject"), reject_admin_register_request_path(request) if can? :reject, request
|
||||||
|
|
||||||
|
.actions
|
||||||
|
%input#approve_registration{:type => 'button', :value => "Approve Selected"}
|
||||||
|
%input#reject_registration{:type => 'button', :value => "Reject Selected"}
|
||||||
|
|
||||||
|
= will_paginate @register_requests
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
$(function() {
|
||||||
|
var $form = $('form.update_form')
|
||||||
|
var change_update_type = function (type) {
|
||||||
|
$('input#update_type').val(type);
|
||||||
|
};
|
||||||
|
$('#approve_registration').live('click', function(e) {
|
||||||
|
//set update_type to 'approve'
|
||||||
|
change_update_type('approve');
|
||||||
|
$form.submit();
|
||||||
|
});
|
||||||
|
$('#reject_registration').live('click', function(e) {
|
||||||
|
//set update_type to 'reject'
|
||||||
|
change_update_type('reject');
|
||||||
|
$form.submit();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
= render 'submenu'
|
|
@ -1,7 +1,7 @@
|
||||||
- content_for :sidebar do
|
- content_for :sidebar do
|
||||||
.bordered
|
.bordered
|
||||||
- if can? :create, User.new
|
- if can? :create, User.new
|
||||||
= link_to t("layout.users.new"), new_user_path, :class => 'button'
|
= link_to t("layout.users.new"), new_admin_user_path, :class => 'button'
|
||||||
%h3= t("layout.users.filter_header")
|
%h3= t("layout.users.filter_header")
|
||||||
%table
|
%table
|
||||||
- t('layout.users.users_filter').each_key do |base|
|
- t('layout.users.users_filter').each_key do |base|
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
"<%= user.uname %>",
|
"<%= user.uname %>",
|
||||||
"<%= user.email %>",
|
"<%= user.email %>",
|
||||||
"<span style='<%=user.access_locked? ? 'background: #FEDEDE' : ''%>'><%= user.role %></span>",
|
"<span style='<%=user.access_locked? ? 'background: #FEDEDE' : ''%>'><%= user.role %></span>",
|
||||||
"<%= j raw [(link_to t('layout.show'), user_path(user) if can? :read, user),
|
"<%= j raw [(link_to t('layout.show'), user if can? :read, user),
|
||||||
(link_to t('layout.edit'), edit_user_path(user) if can? :edit, user),
|
(link_to t('layout.edit'), edit_admin_user_path(user) if can? :edit, user),
|
||||||
(link_to t('layout.delete'), delete_user_path(user), :method => :delete, :confirm => t('layout.users.confirm_delete') if can? :destroy, user)
|
(link_to t('layout.delete'), admin_user_path(user), :method => :delete, :confirm => t('layout.users.confirm_delete') if can? :destroy, user)
|
||||||
].compact.join(' | ') %>"
|
].compact.join(' | ') %>"
|
||||||
]<%= user == @users.last ? '' : ',' %>
|
]<%= user == @users.last ? '' : ',' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
.block
|
||||||
|
.content
|
||||||
|
%h2.title= title t("layout.users.edit_header")
|
||||||
|
.inner
|
||||||
|
= form_for @user, :url => admin_user_path(@user), :html => {:class => :form} do |f|
|
||||||
|
= render "users/base/form", :f => f
|
||||||
|
|
||||||
|
- content_for :sidebar do
|
||||||
|
.bordered.nopadding
|
||||||
|
= render 'submenu'
|
|
@ -23,8 +23,8 @@
|
||||||
%tbody
|
%tbody
|
||||||
%br
|
%br
|
||||||
|
|
||||||
= render :partial => 'admin/users/sidebar'
|
= render 'sidebar'
|
||||||
= render 'admin/submenu'
|
= render 'submenu'
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$('#users_filter[type="radio"]').live('change', function(){
|
$('#users_filter[type="radio"]').live('change', function(){
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
.content
|
.content
|
||||||
%h2.title= title t("layout.users.new_header")
|
%h2.title= title t("layout.users.new_header")
|
||||||
.inner
|
.inner
|
||||||
= form_for @user, :url => create_user_path, :html => { :class => :form } do |f|
|
= form_for @user, :url => admin_users_path, :html => {:class => :form} do |f|
|
||||||
= render :partial => "users/form", :locals => {:f => f}
|
= render "users/base/form", :f => f
|
||||||
|
|
||||||
- content_for :sidebar do
|
- content_for :sidebar do
|
||||||
.bordered.nopadding
|
.bordered.nopadding
|
||||||
|
= render 'submenu'
|
||||||
= render 'admin/submenu'
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
%h3.fix.bpadding10= title @user.uname
|
|
||||||
|
|
||||||
= form_for @user, :url => update_user_path(@user), :html => { :class => :form } do |f|
|
|
||||||
= render :partial => "users/form", :locals => {:f => f}
|
|
||||||
|
|
||||||
.notify
|
|
||||||
%p= t('layout.users.public_data_edit_warning')
|
|
||||||
.notify
|
|
||||||
%p= t('layout.users.avatar_notice')
|
|
||||||
|
|
||||||
:javascript
|
|
||||||
$('article .right').addClass('middlepadding');
|
|
||||||
|
|
||||||
= render 'admin/submenu'
|
|
||||||
- content_for :sidebar do
|
|
||||||
.bordered.nopadding
|
|
|
@ -20,4 +20,4 @@
|
||||||
= image_tag("choose.png", :alt => t("devise.confirmations.send"))
|
= image_tag("choose.png", :alt => t("devise.confirmations.send"))
|
||||||
= t("devise.confirmations.send")
|
= t("devise.confirmations.send")
|
||||||
%span.text_button_padding
|
%span.text_button_padding
|
||||||
= render :partial => "devise/shared/links"
|
= render "devise/shared/links"
|
|
@ -1,7 +1,7 @@
|
||||||
%h3.fix.bpadding10= @user.uname
|
%h3.fix.bpadding10= @user.uname
|
||||||
|
|
||||||
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => "form" }) do |f|
|
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => "form" }) do |f|
|
||||||
= render :partial => "users/form", :locals => {:f => f}
|
= render "users/form", :f => f
|
||||||
|
|
||||||
.notify
|
.notify
|
||||||
%p= t('layout.users.public_data_edit_warning')
|
%p= t('layout.users.public_data_edit_warning')
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
%br/
|
%br/
|
||||||
= f.text_field :email
|
= f.text_field :email
|
||||||
%p= f.submit "Resend unlock instructions"
|
%p= f.submit "Resend unlock instructions"
|
||||||
= render :partial => "devise/shared/links"
|
= render "devise/shared/links"
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
.block
|
|
||||||
.secondary-navigation
|
|
||||||
%ul.wat-cf
|
|
||||||
%li.first.active= link_to t("layout.event_logs.list"), event_logs_path
|
|
||||||
.content
|
|
||||||
%h2.title
|
|
||||||
= title t("layout.event_logs.list_header")
|
|
||||||
.inner
|
|
||||||
%table.table
|
|
||||||
%tr
|
|
||||||
%th.first= t("activerecord.attributes.event_log.kind")
|
|
||||||
%th= t("activerecord.attributes.event_log.created_at")
|
|
||||||
%th= t("activerecord.attributes.event_log.user")
|
|
||||||
%th= t("activerecord.attributes.event_log.ip")
|
|
||||||
%th= t("activerecord.attributes.event_log.protocol")
|
|
||||||
%th.last= t("activerecord.attributes.event_log.description")
|
|
||||||
= render @event_logs
|
|
||||||
.actions-bar.wat-cf
|
|
||||||
.actions= will_paginate
|
|
||||||
|
|
||||||
= render 'admin/submenu'
|
|
|
@ -1,6 +0,0 @@
|
||||||
-set_meta_tags :title => [title_object(@project), "#{t '.title'} #{t('at') if @branch} #{@branch.try :name}"]
|
|
||||||
= render :partial => 'projects/submenu'
|
|
||||||
= render :partial => 'projects/repo_block', :locals => {:project => @project}
|
|
||||||
|
|
||||||
= render :partial => 'git/commits/commits', :object => @commits
|
|
||||||
= render 'git/commits/paginate' if @render_paginate
|
|
|
@ -1,19 +0,0 @@
|
||||||
- act = controller.action_name.to_sym
|
|
||||||
- if [:new, :create].include? act
|
|
||||||
.leftlist
|
|
||||||
= f.label :uname, t("activerecord.attributes.group.uname"), :class => :label
|
|
||||||
.rightlist.nomargin
|
|
||||||
= f.text_field :uname
|
|
||||||
.both
|
|
||||||
%br
|
|
||||||
.leftlist
|
|
||||||
= f.label :description, t("activerecord.attributes.group.description"), :class => :label
|
|
||||||
.rightlist.nomargin
|
|
||||||
= f.text_area :description
|
|
||||||
.both
|
|
||||||
%br
|
|
||||||
.leftlist
|
|
||||||
\
|
|
||||||
.rightlist
|
|
||||||
= submit_tag t("layout.save")
|
|
||||||
.both
|
|
|
@ -6,8 +6,8 @@
|
||||||
.admin-preferences
|
.admin-preferences
|
||||||
%ul
|
%ul
|
||||||
- if can? :edit, @group
|
- if can? :edit, @group
|
||||||
%li{:class => (act == :edit && contr == :groups) ? 'active' : ''}
|
%li{:class => (act == :edit && contr == :profile) ? 'active' : ''}
|
||||||
= link_to t("layout.groups.edit"), edit_group_path(@group)
|
= link_to t("layout.groups.edit"), edit_group_path(@group)
|
||||||
- if can? :manage_members, @group
|
- if can? :manage_members, @group
|
||||||
%li{:class => (act == :edit && contr == :members) ? 'active' : ''}
|
%li{:class => (act == :index && contr == :members) ? 'active' : ''}
|
||||||
= link_to t("layout.groups.edit_members"), edit_group_members_path(@group)
|
= link_to t("layout.groups.edit_members"), group_members_path(@group)
|
|
@ -6,35 +6,28 @@
|
||||||
%tr
|
%tr
|
||||||
%th
|
%th
|
||||||
\
|
\
|
||||||
%th
|
%th= t("layout.collaborators.members")
|
||||||
= t("layout.collaborators.members")
|
%th{:colspan => "3"}= t("layout.collaborators.roles")
|
||||||
%th{:colspan => "3"}
|
|
||||||
= t("layout.collaborators.roles")
|
|
||||||
%tbody
|
%tbody
|
||||||
- @users.each do |user|
|
- (parent.members - [parent.owner]).each do |user|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
%span#niceCheckbox1.niceCheck-main
|
%span#niceCheckbox1.niceCheck-main= check_box_tag "user_remove[#{user.id}][]"
|
||||||
= check_box_tag "user_remove[#{user.id}][]"
|
|
||||||
%td
|
%td
|
||||||
.img
|
.img= image_tag avatar_url(user)
|
||||||
= image_tag avatar_url(user)
|
|
||||||
.forimg= link_to user.name, user_path(user)
|
.forimg= link_to user.name, user_path(user)
|
||||||
- Relation::ROLES.each_with_index do |role, i|
|
- Relation::ROLES.each_with_index do |role, i|
|
||||||
%td
|
%td
|
||||||
.radio
|
.radio= radio_button_tag "user[#{user.id}]", role, ((parent.actors.exists? :actor_id => user.id, :actor_type => 'User', :role => role) ? :checked : nil), :class => 'niceRadio'
|
||||||
= radio_button_tag "user[#{user.id}]", role, ((parent.actors.exists? :actor_id => user.id, :actor_type => 'User', :role => role) ? :checked : nil), :class => 'niceRadio'
|
|
||||||
.forradio= t("layout.collaborators.role_names.#{ role }")
|
.forradio= t("layout.collaborators.role_names.#{ role }")
|
||||||
= link_to_function t("layout.delete"), "deleteAdminMember();", :class => 'button'
|
= link_to_function t("layout.delete"), "deleteAdminMember();", :class => 'button'
|
||||||
.both
|
.both
|
||||||
.hr.top
|
.hr.top
|
||||||
|
|
||||||
= form_tag add_group_members_path(parent) do
|
= form_tag add_group_members_path(parent) do
|
||||||
.admin-search
|
.admin-search= autocomplete_field_tag 'user_id', params[:user_id], autocomplete_user_uname_users_path#, :id_element => '#member_id_field'
|
||||||
= autocomplete_field_tag 'user_id', params[:user_id], autocomplete_user_uname_users_path#, :id_element => '#member_id_field'
|
|
||||||
.admin-role
|
.admin-role
|
||||||
.lineForm
|
.lineForm= select_tag 'role', options_for_collaborators_roles_select
|
||||||
= select_tag 'role', options_for_collaborators_roles_select
|
|
||||||
.both
|
.both
|
||||||
%br
|
%br
|
||||||
= submit_tag t("layout.add"), :class => 'button'
|
= submit_tag t("layout.add"), :class => 'button'
|
||||||
|
@ -43,4 +36,4 @@
|
||||||
.both
|
.both
|
||||||
= link_to_function t("layout.save"), "saveAdminMember();", :class => 'button'
|
= link_to_function t("layout.save"), "saveAdminMember();", :class => 'button'
|
||||||
|
|
||||||
- content_for :sidebar, render('groups/sidebar')
|
- content_for :sidebar, render('sidebar')
|
|
@ -0,0 +1,14 @@
|
||||||
|
- act = controller.action_name.to_sym
|
||||||
|
- if [:new, :create].include? act
|
||||||
|
.leftlist= f.label :uname, t("activerecord.attributes.group.uname"), :class => :label
|
||||||
|
.rightlist.nomargin= f.text_field :uname
|
||||||
|
.both
|
||||||
|
%br
|
||||||
|
.leftlist= f.label :description, t("activerecord.attributes.group.description"), :class => :label
|
||||||
|
.rightlist.nomargin= f.text_area :description
|
||||||
|
.both
|
||||||
|
%br
|
||||||
|
.leftlist
|
||||||
|
\
|
||||||
|
.rightlist= submit_tag t("layout.save")
|
||||||
|
.both
|
|
@ -1,16 +1,13 @@
|
||||||
-set_meta_tags :title => [title_object(@group), t('layout.groups.edit')]
|
-set_meta_tags :title => [title_object(@group), t('layout.groups.edit')]
|
||||||
= form_for @group, :html => { :class => :form, :multipart => true } do |f|
|
= form_for @group do |f|
|
||||||
= render :partial => "form", :locals => {:f => f}
|
= render "form", :f => f
|
||||||
|
|
||||||
.hr
|
.hr
|
||||||
.groups-profile
|
.groups-profile= image_tag('code.png')
|
||||||
= image_tag('code.png')
|
.groups-profile= link_to t("layout.groups.public_profile"), @group
|
||||||
.groups-profile
|
|
||||||
= link_to t("layout.groups.public_profile"), @group
|
|
||||||
.both
|
.both
|
||||||
.hr
|
.hr
|
||||||
.leftside
|
.leftside= t("layout.groups.delete_warning")
|
||||||
= t("layout.groups.delete_warning")
|
|
||||||
.rightside
|
.rightside
|
||||||
= link_to t("layout.delete"), group_path(@group), :method => :delete, :confirm => t("layout.groups.confirm_delete"), :class => 'button' if can? :destroy, @group
|
= link_to t("layout.delete"), group_path(@group), :method => :delete, :confirm => t("layout.groups.confirm_delete"), :class => 'button' if can? :destroy, @group
|
||||||
.both
|
.both
|
|
@ -12,4 +12,4 @@
|
||||||
%td= link_to group.name, group_path(group)
|
%td= link_to group.name, group_path(group)
|
||||||
%td.td2= group.description
|
%td.td2= group.description
|
||||||
%td.td5
|
%td.td5
|
||||||
= link_to image_tag('x.png'), remove_group_member_path(group, current_user), :method => :delete unless group.owner_id == current_user.id
|
= link_to image_tag('x.png'), remove_user_group_path(group), :method => :delete unless group.owner_id == current_user.id
|
|
@ -1,6 +1,6 @@
|
||||||
%h3.bpadding10= title t("layout.groups.new_header")
|
%h3.bpadding10= title t("layout.groups.new_header")
|
||||||
= form_for @group, :url => groups_path do |f|
|
= form_for @group do |f|
|
||||||
= render :partial => "form", :locals => {:f => f}
|
= render "form", :f => f
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$('article .all').addClass('bigpadding');
|
$('article .all').addClass('bigpadding');
|
|
@ -5,7 +5,7 @@
|
||||||
%p= @group.description
|
%p= @group.description
|
||||||
%h4= t("layout.groups.projects_list") + ":"
|
%h4= t("layout.groups.projects_list") + ":"
|
||||||
%p
|
%p
|
||||||
- @group.projects.each do |project|
|
- @projects.each do |project|
|
||||||
= link_to project.name, project
|
= link_to project.name, project
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
|
@ -19,7 +19,7 @@
|
||||||
.middle
|
.middle
|
||||||
%menu
|
%menu
|
||||||
.logo= link_to image_tag('logo-mini.png', :alt => 'logo'), root_path
|
.logo= link_to image_tag('logo-mini.png', :alt => 'logo'), root_path
|
||||||
= render :partial => 'layouts/menu/top', :locals => {:which_menu => 'top_menu'}
|
= render 'layouts/menu/top', :which_menu => 'top_menu'
|
||||||
.information
|
.information
|
||||||
= render 'search/form'
|
= render 'search/form'
|
||||||
- if current_user
|
- if current_user
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
.droplist-wrap
|
.droplist-wrap
|
||||||
#droplist.droplist
|
#droplist.droplist
|
||||||
.a= link_to current_user.uname, current_user
|
.a= link_to current_user.uname, current_user
|
||||||
.a= link_to t('layout.settings.label'), edit_profile_path
|
.a= link_to t('layout.settings.label'), profile_settings_path
|
||||||
.a= link_to t('layout.logout'), destroy_user_session_path, :method => :delete
|
.a= link_to t('layout.logout'), destroy_user_session_path, :method => :delete
|
||||||
- else
|
- else
|
||||||
.user
|
.user
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
- namespace = which_menu == 'admins_menu' ? 'admin_' : ''
|
||||||
%ul
|
%ul
|
||||||
- (collection = t which_menu).each do |base, title|
|
- (collection = t which_menu).each do |base, title|
|
||||||
- if can? :index, base.to_s.classify.constantize
|
- if can? :index, base.to_s.classify.constantize
|
||||||
%li= link_to title, send(:"#{base}_path"), :class => controller_name == base.to_s ? 'active' : ''
|
%li= link_to title, send(:"#{namespace}#{base}_path"), :class => params[:controller].include?(base.to_s) ? 'active' : ''
|
||||||
- if current_user.try(:admin?) and which_menu == 'top_menu'
|
- if current_user.try(:admin?) and which_menu == 'top_menu'
|
||||||
%li= link_to t('admins_menu_header'), users_path, :class => t('admins_menu').has_key?(controller_name.to_sym) ? 'active' : ''
|
%li= link_to t('admins_menu_header'), admin_users_path, :class => t('admins_menu').has_key?(controller_name.to_sym) ? 'active' : ''
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
= display_meta_tags :site => APP_CONFIG['project_name'], :reverse => true, :separator => '-'
|
= display_meta_tags :site => APP_CONFIG['project_name'], :reverse => true, :separator => '-'
|
||||||
|
|
||||||
%body
|
%body
|
||||||
-# render :partial => "layouts/flashes"
|
-# render "layouts/flashes"
|
||||||
= yield
|
= yield
|
||||||
|
|
||||||
= render 'layouts/counters' unless current_user.try(:admin?)
|
= render 'layouts/counters' unless current_user.try(:admin?)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
- render :partial => 'tos_sidebar'
|
- render 'tos_sidebar'
|
||||||
|
|
||||||
.tos
|
.tos
|
||||||
%a{:name => '#'}
|
%a{:name => '#'}
|
||||||
|
|
|
@ -22,8 +22,3 @@
|
||||||
-#- if current_user.owner_of? @platform or current_user.admin?
|
-#- if current_user.owner_of? @platform or current_user.admin?
|
||||||
%li{:class => (act == :index && contr == :private_users) ? 'active' : ''}
|
%li{:class => (act == :index && contr == :private_users) ? 'active' : ''}
|
||||||
= link_to t("layout.platforms.private_users"), platform_private_users_path(@platform)
|
= link_to t("layout.platforms.private_users"), platform_private_users_path(@platform)
|
||||||
-#.block.notice
|
|
||||||
%h3= t("layout.groups.members")
|
|
||||||
.content
|
|
||||||
- @platform.members.uniq.each do |member|
|
|
||||||
%p= link_to member.name + "", user_path(member)
|
|
|
@ -1,13 +0,0 @@
|
||||||
-set_meta_tags :title => [title_object(@platform), t('layout.platforms.edit')]
|
|
||||||
= render :partial => 'submenu'
|
|
||||||
= render :partial => 'sidebar'
|
|
||||||
|
|
||||||
= form_for @platform, :url => platform_path(@platform), :html => { :class => :form } do |f|
|
|
||||||
= render :partial => "form", :locals => {:f => f}
|
|
||||||
|
|
||||||
- if can? :destroy, @platform
|
|
||||||
.hr
|
|
||||||
.leftside
|
|
||||||
= t("layout.platforms.delete_warning")
|
|
||||||
.rightside
|
|
||||||
= link_to t("layout.delete"), platform_path(@platform), :method => :delete, :confirm => t("layout.platforms.confirm_delete"), :class => 'button'
|
|
|
@ -1,16 +0,0 @@
|
||||||
%h3= title t("layout.platforms.new_header")
|
|
||||||
|
|
||||||
= form_for :platform, :url => platforms_path, :html => { :class => :form } do |f|
|
|
||||||
= render :partial => "form", :locals => {:f => f}
|
|
||||||
|
|
||||||
-#.block
|
|
||||||
.secondary-navigation
|
|
||||||
%ul.wat-cf
|
|
||||||
%li.first= link_to "#{t("layout.platforms.list")}", platforms_path
|
|
||||||
%li.active= link_to "#{t("layout.platforms.new")}", new_platform_path
|
|
||||||
.content
|
|
||||||
%h2.title
|
|
||||||
= t("layout.platforms.new_header")
|
|
||||||
.inner
|
|
||||||
= form_for :platform, :url => platforms_path, :html => { :class => :form } do |f|
|
|
||||||
= render :partial => "form", :locals => {:f => f}
|
|
|
@ -6,7 +6,5 @@
|
||||||
%tbody
|
%tbody
|
||||||
- @platforms.each do |platform|
|
- @platforms.each do |platform|
|
||||||
%tr{:class => cycle("odd", "even")}
|
%tr{:class => cycle("odd", "even")}
|
||||||
%td
|
%td= link_to platfrom_printed_name(platform), platform_path(platform)
|
||||||
= link_to platfrom_printed_name(platform), platform_path(platform)
|
%td= platform.distrib_type
|
||||||
%td
|
|
||||||
= platform.distrib_type
|
|
|
@ -1,6 +1,6 @@
|
||||||
-set_meta_tags :title => [title_object(@platform), t('layout.platforms.clone_header')]
|
-set_meta_tags :title => [title_object(@platform), t('layout.platforms.clone_header')]
|
||||||
= render :partial => 'submenu'
|
= render 'submenu'
|
||||||
= render :partial => 'sidebar'
|
= render 'sidebar'
|
||||||
|
|
||||||
= form_for @cloned, :url => make_clone_platform_path(@platform), :html => { :class => :form } do |f|
|
= form_for @cloned, :url => make_clone_platform_path(@platform), :html => { :class => :form } do |f|
|
||||||
.leftlist= f.label :name, :class => :label
|
.leftlist= f.label :name, :class => :label
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue