merge master

This commit is contained in:
Karol
2019-12-09 20:54:24 +01:00
7 changed files with 444 additions and 212 deletions

View File

@ -38,6 +38,8 @@ before_install:
install: install:
- bundle install --jobs=3 --retry=3 --deployment --path=${BUNDLE_PATH:-vendor/bundle} - bundle install --jobs=3 --retry=3 --deployment --path=${BUNDLE_PATH:-vendor/bundle}
- nvm install stable
- nvm use stable
- yarn install - yarn install
before_script: before_script:

View File

@ -17,7 +17,7 @@ gem 'pg'
gem 'pry-byebug' gem 'pry-byebug'
gem 'puma' gem 'puma'
gem 'pundit' gem 'pundit'
gem 'rails', '5.2.3' gem 'rails', '5.2.4'
gem 'rails-i18n' gem 'rails-i18n'
gem 'i18n-js' gem 'i18n-js'
gem 'ransack' gem 'ransack'

View File

@ -22,43 +22,43 @@ GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
ZenTest (4.12.0) ZenTest (4.12.0)
actioncable (5.2.3) actioncable (5.2.4)
actionpack (= 5.2.3) actionpack (= 5.2.4)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
actionmailer (5.2.3) actionmailer (5.2.4)
actionpack (= 5.2.3) actionpack (= 5.2.4)
actionview (= 5.2.3) actionview (= 5.2.4)
activejob (= 5.2.3) activejob (= 5.2.4)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (5.2.3) actionpack (5.2.4)
actionview (= 5.2.3) actionview (= 5.2.4)
activesupport (= 5.2.3) activesupport (= 5.2.4)
rack (~> 2.0) rack (~> 2.0)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.3) actionview (5.2.4)
activesupport (= 5.2.3) activesupport (= 5.2.4)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3) rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.3) activejob (5.2.4)
activesupport (= 5.2.3) activesupport (= 5.2.4)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.2.3) activemodel (5.2.4)
activesupport (= 5.2.3) activesupport (= 5.2.4)
activerecord (5.2.3) activerecord (5.2.4)
activemodel (= 5.2.3) activemodel (= 5.2.4)
activesupport (= 5.2.3) activesupport (= 5.2.4)
arel (>= 9.0) arel (>= 9.0)
activestorage (5.2.3) activestorage (5.2.4)
actionpack (= 5.2.3) actionpack (= 5.2.4)
activerecord (= 5.2.3) activerecord (= 5.2.4)
marcel (~> 0.3.1) marcel (~> 0.3.1)
activesupport (5.2.3) activesupport (5.2.4)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
@ -221,7 +221,7 @@ GEM
netrc (0.11.0) netrc (0.11.0)
newrelic_rpm (6.7.0.359) newrelic_rpm (6.7.0.359)
nio4r (2.5.2) nio4r (2.5.2)
nokogiri (1.10.5) nokogiri (1.10.7)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
nyan-cat-formatter (0.12.0) nyan-cat-formatter (0.12.0)
rspec (>= 2.99, >= 2.14.2, < 4) rspec (>= 2.99, >= 2.14.2, < 4)
@ -261,18 +261,18 @@ GEM
rack rack
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails (5.2.3) rails (5.2.4)
actioncable (= 5.2.3) actioncable (= 5.2.4)
actionmailer (= 5.2.3) actionmailer (= 5.2.4)
actionpack (= 5.2.3) actionpack (= 5.2.4)
actionview (= 5.2.3) actionview (= 5.2.4)
activejob (= 5.2.3) activejob (= 5.2.4)
activemodel (= 5.2.3) activemodel (= 5.2.4)
activerecord (= 5.2.3) activerecord (= 5.2.4)
activestorage (= 5.2.3) activestorage (= 5.2.4)
activesupport (= 5.2.3) activesupport (= 5.2.4)
bundler (>= 1.3.0) bundler (>= 1.3.0)
railties (= 5.2.3) railties (= 5.2.4)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4) rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x) actionpack (>= 5.0.1.x)
@ -289,9 +289,9 @@ GEM
rails-timeago (2.18.0) rails-timeago (2.18.0)
actionpack (>= 3.1) actionpack (>= 3.1)
activesupport (>= 3.1) activesupport (>= 3.1)
railties (5.2.3) railties (5.2.4)
actionpack (= 5.2.3) actionpack (= 5.2.4)
activesupport (= 5.2.3) activesupport (= 5.2.4)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0) thor (>= 0.19.0, < 2.0)
@ -481,7 +481,7 @@ DEPENDENCIES
puma puma
pundit pundit
rack-mini-profiler rack-mini-profiler
rails (= 5.2.3) rails (= 5.2.4)
rails-controller-testing rails-controller-testing
rails-i18n rails-i18n
rails-timeago rails-timeago

View File

@ -26,11 +26,16 @@ class ApplicationPolicy
private :no_one private :no_one
def everyone_in_study_group def everyone_in_study_group
study_group = @record.study_group if @record.respond_to? :study_group # e.g. submission
return false if study_group.blank? study_group = @record.study_group
return false if study_group.blank?
users_in_same_study_group = study_group.users users_in_same_study_group = study_group.users
return false if users_in_same_study_group.blank? else # e.g. exercise
study_groups = @record.user.study_groups
users_in_same_study_group = study_groups.collect{ |study_group|
study_group.users}.flatten
end
users_in_same_study_group.include? @user users_in_same_study_group.include? @user
end end

View File

@ -8,7 +8,7 @@ class ExercisePolicy < AdminOrAuthorPolicy
end end
[:clone?, :destroy?, :edit?, :update?, :export_external_check?, :export_external_confirm?].each do |action| [:clone?, :destroy?, :edit?, :update?, :export_external_check?, :export_external_confirm?].each do |action|
define_method(action) { admin? || author? } define_method(action) { admin? || teacher_in_study_group || author? }
end end
[:implement?, :working_times?, :intervention?, :search?, :submit?, :reload?].each do |action| [:implement?, :working_times?, :intervention?, :search?, :submit?, :reload?].each do |action|

View File

@ -1,8 +1,8 @@
{ {
"dependencies": { "dependencies": {
"@rails/webpacker": "4.0", "@rails/webpacker": "4.2",
"bootstrap": "^4.1.3", "bootstrap": "^4.1.3",
"bootswatch": "^4.1.3", "bootswatch": "^4.4.1",
"chosen-js": "^1.8.7", "chosen-js": "^1.8.7",
"d3": "^5.9.2", "d3": "^5.9.2",
"d3-tip": "^0.9.1", "d3-tip": "^0.9.1",
@ -13,13 +13,13 @@
"jstree": "^3.3.8", "jstree": "^3.3.8",
"opensans-webkit": "^1.0.1", "opensans-webkit": "^1.0.1",
"popper.js": "^1.15.0", "popper.js": "^1.15.0",
"snyk": "^1.189.0", "snyk": "^1.256.0",
"underscore": "^1.9.1", "underscore": "^1.9.1",
"vis": "^4.21.0", "vis": "^4.21.0",
"webpack-merge": "^4.1.4" "webpack-merge": "^4.1.4"
}, },
"devDependencies": { "devDependencies": {
"webpack-dev-server": "3.4.1" "webpack-dev-server": "3.9.0"
}, },
"scripts": { "scripts": {
"webpack": "./bin/webpack", "webpack": "./bin/webpack",

553
yarn.lock

File diff suppressed because it is too large Load Diff