Skip to content

Commit

Permalink
Merge pull request #511 from MaMpf-HD/mampf-next
Browse files Browse the repository at this point in the history
Continuous Release 1.6.0
  • Loading branch information
Splines authored Jun 6, 2023
2 parents f6dd9d2 + cb46762 commit 55e9cb3
Show file tree
Hide file tree
Showing 181 changed files with 3,907 additions and 3,089 deletions.
19 changes: 18 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ Style/RedundantFreeze:
Style/SymbolProc:
Enabled: true

Style/SymbolArray:
Enabled: false

# Use `foo {}` not `foo{}`.
Layout/SpaceBeforeBlockBraces:
Enabled: true
Expand Down Expand Up @@ -321,4 +324,18 @@ Performance/DeletePrefix:
Enabled: true

Performance/DeleteSuffix:
Enabled: true
Enabled: true

Metrics/ModuleLength:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/MethodLength:
Exclude:
- 'app/abilities/**/*'

Metrics/AbcSize:
Exclude:
- 'app/abilities/**/*'
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ gem "sidekiq-cron", "~> 1.1"
gem "faraday", "~> 1.8"
gem "globalize"
gem "globalize-accessors"
gem "commontator",
git: "https://github.com/MaMpf-HD/commontator.git",
branch: "main"
gem "commontator"
gem "acts_as_votable"
gem "sprockets-rails",
git: "https://github.com/rails/sprockets-rails",
Expand All @@ -120,7 +118,7 @@ group :development, :docker_development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "rubocop", "~> 0.93", require: false
gem "rubocop", "~> 1.50", require: false
gem "rubocop-packaging", require: false
gem "rubocop-performance", require: false
gem "rubocop-rails", require: false
Expand Down
38 changes: 17 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
GIT
remote: https://github.com/MaMpf-HD/commontator.git
revision: 38b25d2f3f4e4e2d1a0a7b608f04c579a93125f9
branch: main
specs:
commontator (7.0.0)
rails (>= 6.0)
sprockets-rails
will_paginate

GIT
remote: https://github.com/rails/sprockets-rails
revision: 73e7351abff3506f6dca6b2da8abedfd5c7c0d77
Expand Down Expand Up @@ -174,6 +164,10 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
commontator (7.0.0)
rails (>= 6.0)
sprockets-rails
will_paginate
concurrent-ruby (1.2.2)
connection_pool (2.4.0)
content_disposition (1.0.0)
Expand Down Expand Up @@ -304,6 +298,7 @@ GEM
js-routes (1.4.9)
railties (>= 4)
sprockets-rails
json (2.6.3)
jsonapi-renderer (0.2.2)
kaminari (1.2.2)
activesupport (>= 4.1.0)
Expand Down Expand Up @@ -377,7 +372,7 @@ GEM
options (2.3.2)
orm_adapter (0.5.0)
pairing_heap (3.0.0)
parallel (1.22.1)
parallel (1.23.0)
parser (3.2.2.0)
ast (~> 2.4.1)
pdf-reader (2.11.0)
Expand Down Expand Up @@ -458,7 +453,7 @@ GEM
ffi (~> 1.0)
redis-client (0.14.1)
connection_pool
regexp_parser (2.7.0)
regexp_parser (2.8.0)
request_store (1.5.1)
rack (>= 1.4)
responders (3.1.0)
Expand Down Expand Up @@ -499,15 +494,16 @@ GEM
rspec-mocks (~> 3.11)
rspec-support (~> 3.11)
rspec-support (3.12.0)
rubocop (0.93.1)
rubocop (1.50.2)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 2.7.1.5)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
rexml
rubocop-ast (>= 0.6.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
parser (>= 3.2.1.0)
rubocop-packaging (0.5.1)
Expand Down Expand Up @@ -629,7 +625,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
unicode-display_width (2.4.2)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.0)
Expand Down Expand Up @@ -672,7 +668,7 @@ DEPENDENCIES
cancancan
clipboard-rails
coffee-rails (~> 5.0.0)
commontator!
commontator
coveralls
cypress-on-rails (~> 1.0)
dalli (>= 2.7)
Expand Down Expand Up @@ -718,7 +714,7 @@ DEPENDENCIES
rgl
rqrcode
rspec-rails
rubocop (~> 0.93)
rubocop (~> 1.50)
rubocop-packaging
rubocop-performance
rubocop-rails
Expand Down
2 changes: 1 addition & 1 deletion app/abilities/administration_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def initialize(user)
user.admin?
end
end
end
end
4 changes: 2 additions & 2 deletions app/abilities/announcement_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(user)

can :create, Announcement do |announcement|
user.admin? ||
(announcement.lecture.present? && user.can_edit?(announcement.lecture))
(announcement.lecture.present? && user.can_edit?(announcement.lecture))
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/answer_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def initialize(user)

can :update_answer_box, Answer
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/assignment_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def initialize(user)
assignment.lecture.present? && user.can_edit?(assignment.lecture)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/chapter_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def initialize(user)
chapter.lecture.present? && user.can_edit?(chapter.lecture)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/course_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def initialize(user)
!user.generic? || course.subscribed_by?(user)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/division_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.admin?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/erdbeere_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def initialize(user)
!user.generic?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/interaction_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.admin?
end
end
end
end
4 changes: 2 additions & 2 deletions app/abilities/item_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ def initialize(user)

can [:create, :update, :edit, :destroy], Item do |item|
(item.medium.nil? && !user.generic?) ||
(item.medium && user.can_edit?(item.medium))
(item.medium && user.can_edit?(item.medium))
end

can :display, Item
end
end
end
4 changes: 2 additions & 2 deletions app/abilities/lecture_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def initialize(user)
end

can :subscribe_page, Lecture do |lecture|
lecture.published? || !user.generic?
lecture.published? || user.active_teachable_editor?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/lesson_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def initialize(user)
user.can_edit?(lesson)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/main_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ class MainAbility
def initialize(user)
can :start, :main
end
end
end
8 changes: 4 additions & 4 deletions app/abilities/medium_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ def initialize(user)
can [:index, :new, :search], Medium

can [:show, :show_comments], Medium do |medium|
medium.visible_for_user?(user) &&
!(medium.sort.in?(['Question', 'Remark']) && !user.can_edit?(medium))
medium.visible_for_user?(user) &&
!(medium.sort.in?(['Question', 'Remark']) && !user.can_edit?(medium))
end

can :inspect, Medium do |medium|
Expand Down Expand Up @@ -39,7 +39,7 @@ def initialize(user)
# guest users can play/display media when their release status 'all'
can [:play, :display, :geogebra], Medium do |medium|
(!user.new_record? && medium.visible_for_user?(user)) ||
medium.free?
medium.free?
end

can :update_tags, Medium do |medium|
Expand All @@ -50,4 +50,4 @@ def initialize(user)
!user.new_record?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/notification_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def initialize(user)
notification.recipient == user
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/profile_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
:toggle_thread_subscription, :subscribe_lecture, :unsubscribe_lecture,
:star_lecture, :unstar_lecture, :show_accordion, :request_data], :profile
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/program_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.admin?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/question_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def initialize(user)
user.can_edit?(question)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/quiz_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def initialize(user)
quiz && user.can_edit?(quiz.becomes(Medium))
end
end
end
end
4 changes: 2 additions & 2 deletions app/abilities/quiz_certificate_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(user)
can :claim, QuizCertificate

can :validate, QuizCertificate do
user.tutor? || !user.generic?
user.tutor? || user.can_edit_teachables?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/referral_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def initialize(user)
!user.generic? || user.media_editor?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/remark_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.can_edit?(remark)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/search_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def initialize(user)

can :index, :search
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/section_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def initialize(user)
user.can_edit?(section.lecture)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/subject_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.admin?
end
end
end
end
6 changes: 3 additions & 3 deletions app/abilities/submission_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def initialize(user)
end

can [:show_manuscript, :show_correction], Submission do |submission|
user.in?(submission.users) || user.in?(submission.tutorial.tutors) ||
user.in?(submission.tutorial.lecture.editors) ||
user == submission.tutorial.lecture.teacher
user.in?(submission.users) || user.in?(submission.tutorial.tutors) ||
user.in?(submission.tutorial.lecture.editors) ||
user == submission.tutorial.lecture.teacher
end
end
end
1 change: 0 additions & 1 deletion app/abilities/tag_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ def initialize(user)
end
end
end

2 changes: 1 addition & 1 deletion app/abilities/term_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def initialize(user)
user.admin?
end
end
end
end
Loading

0 comments on commit 55e9cb3

Please sign in to comment.