From cc973363608b244212c13d6beb61be9d250037f8 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 29 Jan 2024 16:21:00 +0100 Subject: [PATCH 01/35] Require at least one correct submission before publishing --- app/models/activity.rb | 16 ++++++++++++++++ config/locales/models/en.yml | 2 ++ config/locales/models/nl.yml | 2 ++ test/models/activity_test.rb | 16 ++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/app/models/activity.rb b/app/models/activity.rb index c7e2ff120f..dff1962fe3 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -57,6 +57,7 @@ class Activity < ApplicationRecord has_many :labels, through: :activity_labels validates :path, uniqueness: { scope: :repository_id, case_sensitive: false }, allow_nil: true + validate :require_valid_submission_before_publish token_generator :repository_token, length: 64 token_generator :access_token @@ -510,4 +511,19 @@ def unique_labels(hash) hash['labels'] = hash['labels'].uniq if hash.key? 'labels' hash end + + def valid_submission? + return true if content_page? + + submissions.any?(&:accepted?) + end + + def require_valid_submission_before_publish + return if draft? + return unless draft_was + return if valid_submission? + + errors.add(:draft, I18n.t('activerecord.errors.models.activity.no_valid_submission')) + self.draft = true + end end diff --git a/config/locales/models/en.yml b/config/locales/models/en.yml index 27086273a8..eeadee892c 100644 --- a/config/locales/models/en.yml +++ b/config/locales/models/en.yml @@ -2,6 +2,8 @@ en: activerecord: errors: models: + activity: + no_valid_submission: "At least one correct submission is required, before the activity can be published." course_membership: at_least_one_admin: The course should always have at least one course administrator. api_token: diff --git a/config/locales/models/nl.yml b/config/locales/models/nl.yml index 2b74d68389..195d743172 100644 --- a/config/locales/models/nl.yml +++ b/config/locales/models/nl.yml @@ -2,6 +2,8 @@ nl: activerecord: errors: models: + activity: + no_valid_submission: "Er moet minstens één geldige oplossing zijn, vooraleer de activiteit kan worden gepubliceerd." course_membership: at_least_one_admin: Een cursus moet altijd minstens één cursusbeheerder hebben. api_token: diff --git a/test/models/activity_test.rb b/test/models/activity_test.rb index 397e416b06..36621c1f96 100644 --- a/test/models/activity_test.rb +++ b/test/models/activity_test.rb @@ -304,4 +304,20 @@ class ActivityTest < ActiveSupport::TestCase assert_empty Activity.repository_scope(scope: :my_institution, user: nil) assert_empty Activity.repository_scope(scope: :my_institution, user: create(:user, institution_id: nil)) end + + test 'should have at least one valid submission before publishing' do + activity = create :exercise, draft: true + activity.update(draft: false) + + assert_not_empty activity.errors + assert_predicate activity.reload, :draft? + + # reset errors + activity = Activity.find(activity.id) + create :correct_submission, exercise: activity + activity.update(draft: false) + + assert_empty activity.errors + assert_not activity.reload.draft? + end end From 1c6077a9208a595d933a20c3b90dbb4890f541c3 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 29 Jan 2024 16:26:42 +0100 Subject: [PATCH 02/35] Improve error message --- app/models/activity.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/activity.rb b/app/models/activity.rb index dff1962fe3..14d71bfe35 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -523,7 +523,7 @@ def require_valid_submission_before_publish return unless draft_was return if valid_submission? - errors.add(:draft, I18n.t('activerecord.errors.models.activity.no_valid_submission')) + errors.add(:base, I18n.t('activerecord.errors.models.activity.no_valid_submission')) self.draft = true end end From bc476e7553451d1215a5fe32fa71d9a63c2816bd Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 29 Jan 2024 16:27:19 +0100 Subject: [PATCH 03/35] Rename to exercise --- config/locales/models/en.yml | 2 +- config/locales/models/nl.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/models/en.yml b/config/locales/models/en.yml index eeadee892c..417a5cecf9 100644 --- a/config/locales/models/en.yml +++ b/config/locales/models/en.yml @@ -3,7 +3,7 @@ en: errors: models: activity: - no_valid_submission: "At least one correct submission is required, before the activity can be published." + no_valid_submission: "At least one correct submission is required, before the exercise can be published." course_membership: at_least_one_admin: The course should always have at least one course administrator. api_token: diff --git a/config/locales/models/nl.yml b/config/locales/models/nl.yml index 195d743172..dba7e24e84 100644 --- a/config/locales/models/nl.yml +++ b/config/locales/models/nl.yml @@ -3,7 +3,7 @@ nl: errors: models: activity: - no_valid_submission: "Er moet minstens één geldige oplossing zijn, vooraleer de activiteit kan worden gepubliceerd." + no_valid_submission: "Er moet minstens één geldige oplossing zijn, vooraleer de oefening kan worden gepubliceerd." course_membership: at_least_one_admin: Een cursus moet altijd minstens één cursusbeheerder hebben. api_token: From 6e618e29f8ac61b84120a7d4413009bf2154baf3 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 29 Jan 2024 17:15:20 +0100 Subject: [PATCH 04/35] Fix tests --- app/models/activity.rb | 2 +- test/controllers/activities_controller_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/activity.rb b/app/models/activity.rb index 14d71bfe35..eb70b1debd 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -57,7 +57,7 @@ class Activity < ApplicationRecord has_many :labels, through: :activity_labels validates :path, uniqueness: { scope: :repository_id, case_sensitive: false }, allow_nil: true - validate :require_valid_submission_before_publish + validate :require_valid_submission_before_publish, on: :update token_generator :repository_token, length: 64 token_generator :access_token diff --git a/test/controllers/activities_controller_test.rb b/test/controllers/activities_controller_test.rb index e9f9cb1874..a9805a1cd5 100644 --- a/test/controllers/activities_controller_test.rb +++ b/test/controllers/activities_controller_test.rb @@ -802,6 +802,7 @@ def create_exercises_return_valid repo = create :repository, :git_stubbed repo.admins << user exercise = create :exercise, repository: repo, draft: true + create :correct_submission, exercise: exercise put activity_url(exercise), params: { activity: { draft: false } } From d1253e01ca111a061a788e9f4ccdf172d21caf94 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Tue, 30 Jan 2024 09:55:47 +0100 Subject: [PATCH 05/35] Rename valid to correct --- app/models/activity.rb | 10 +++++----- config/locales/models/en.yml | 2 +- config/locales/models/nl.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/activity.rb b/app/models/activity.rb index eb70b1debd..9e34eff3b2 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -57,7 +57,7 @@ class Activity < ApplicationRecord has_many :labels, through: :activity_labels validates :path, uniqueness: { scope: :repository_id, case_sensitive: false }, allow_nil: true - validate :require_valid_submission_before_publish, on: :update + validate :require_correct_submission_before_publish, on: :update token_generator :repository_token, length: 64 token_generator :access_token @@ -512,18 +512,18 @@ def unique_labels(hash) hash end - def valid_submission? + def correct_submission? return true if content_page? submissions.any?(&:accepted?) end - def require_valid_submission_before_publish + def require_correct_submission_before_publish return if draft? return unless draft_was - return if valid_submission? + return if correct_submission? - errors.add(:base, I18n.t('activerecord.errors.models.activity.no_valid_submission')) + errors.add(:base, I18n.t('activerecord.errors.models.activity.no_correct_submission')) self.draft = true end end diff --git a/config/locales/models/en.yml b/config/locales/models/en.yml index 417a5cecf9..227bea937b 100644 --- a/config/locales/models/en.yml +++ b/config/locales/models/en.yml @@ -3,7 +3,7 @@ en: errors: models: activity: - no_valid_submission: "At least one correct submission is required, before the exercise can be published." + no_correct_submission: "At least one correct submission is required, before the exercise can be published." course_membership: at_least_one_admin: The course should always have at least one course administrator. api_token: diff --git a/config/locales/models/nl.yml b/config/locales/models/nl.yml index dba7e24e84..fbcc20f010 100644 --- a/config/locales/models/nl.yml +++ b/config/locales/models/nl.yml @@ -3,7 +3,7 @@ nl: errors: models: activity: - no_valid_submission: "Er moet minstens één geldige oplossing zijn, vooraleer de oefening kan worden gepubliceerd." + no_correct_submission: "Er moet minstens één correcte oplossing zijn, vooraleer de oefening kan worden gepubliceerd." course_membership: at_least_one_admin: Een cursus moet altijd minstens één cursusbeheerder hebben. api_token: From 145b5b8decccac06005ea31c7145793e25df1ff8 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Tue, 30 Jan 2024 16:17:22 +0100 Subject: [PATCH 06/35] Add extra validations --- app/models/activity.rb | 14 +++++++++++--- config/locales/models/en.yml | 2 ++ config/locales/models/nl.yml | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/models/activity.rb b/app/models/activity.rb index 9e34eff3b2..af6a333f0a 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -518,12 +518,20 @@ def correct_submission? submissions.any?(&:accepted?) end + def valid_config? + config + true + rescue ConfigParseError + false + end + def require_correct_submission_before_publish return if draft? return unless draft_was - return if correct_submission? - errors.add(:base, I18n.t('activerecord.errors.models.activity.no_correct_submission')) - self.draft = true + errors.add(:base, I18n.t('activerecord.errors.models.activity.no_correct_submission')) unless correct_submission? + errors.add(:base, I18n.t('activerecord.errors.models.activity.not_valid')) if not_valid? + errors.add(:base, I18n.t('activerecord.errors.models.activity.invalid_config')) unless valid_config? + self.draft = true if errors.any? end end diff --git a/config/locales/models/en.yml b/config/locales/models/en.yml index 227bea937b..c6618179d1 100644 --- a/config/locales/models/en.yml +++ b/config/locales/models/en.yml @@ -4,6 +4,8 @@ en: models: activity: no_correct_submission: "At least one correct submission is required, before the exercise can be published." + not_valid: "The exercise must have a name and a description." + invalid_config: "The JSON configuration is invalid." course_membership: at_least_one_admin: The course should always have at least one course administrator. api_token: diff --git a/config/locales/models/nl.yml b/config/locales/models/nl.yml index fbcc20f010..9d4e3bddef 100644 --- a/config/locales/models/nl.yml +++ b/config/locales/models/nl.yml @@ -4,6 +4,8 @@ nl: models: activity: no_correct_submission: "Er moet minstens één correcte oplossing zijn, vooraleer de oefening kan worden gepubliceerd." + not_valid: "De oefening moet een naam en een beschrijving hebben." + invalid_config: "De JSON-configuratie is ongeldig." course_membership: at_least_one_admin: Een cursus moet altijd minstens één cursusbeheerder hebben. api_token: From 77256404c7bd1e402043adbb756092b38a2c2e70 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Wed, 31 Jan 2024 10:36:03 +0100 Subject: [PATCH 07/35] Show conditions to user --- .../stylesheets/models/activities.css.scss | 20 +++++++++++++ app/models/activity.rb | 26 ++++++++--------- app/views/activities/_draft_notice.html.erb | 29 +++++++++++++++++-- config/locales/views/activities/en.yml | 9 ++++-- config/locales/views/activities/nl.yml | 9 ++++-- 5 files changed, 73 insertions(+), 20 deletions(-) diff --git a/app/assets/stylesheets/models/activities.css.scss b/app/assets/stylesheets/models/activities.css.scss index 37d47c35e6..763037b87d 100644 --- a/app/assets/stylesheets/models/activities.css.scss +++ b/app/assets/stylesheets/models/activities.css.scss @@ -203,3 +203,23 @@ center img { background-color: var(--d-code-bg); } } + +.draft-notice { + .form-check-input[disabled] ~ .form-check-label, .form-check-input:disabled ~ .form-check-label { + opacity: 1; + } + + .form-check-input:disabled { + opacity: 1; + } + + .form-check-input:checked { + background-color: var(--d-warning); + border-color: var(--d-warning); + } + + .form-check-input { + background-color: transparent; + border-color: var(--d-warning); + } +} diff --git a/app/models/activity.rb b/app/models/activity.rb index af6a333f0a..404fd8ce2d 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -443,6 +443,19 @@ def types end end + def correct_submission? + return true if content_page? + + submissions.any?(&:accepted?) + end + + def valid_config? + config + true + rescue ConfigParseError + false + end + private def activity_status_for(user, series = nil) @@ -512,19 +525,6 @@ def unique_labels(hash) hash end - def correct_submission? - return true if content_page? - - submissions.any?(&:accepted?) - end - - def valid_config? - config - true - rescue ConfigParseError - false - end - def require_correct_submission_before_publish return if draft? return unless draft_was diff --git a/app/views/activities/_draft_notice.html.erb b/app/views/activities/_draft_notice.html.erb index aef08b3522..6ca367eaa1 100644 --- a/app/views/activities/_draft_notice.html.erb +++ b/app/views/activities/_draft_notice.html.erb @@ -1,13 +1,36 @@ <% if @activity.draft? %> -
+
- <%= t "activities.show.alert_draft_html" %> + <%= t "activities.show.alert_draft.text_html" %> <% if policy(@activity).edit? %> <% edit_path = @series.present? ? course_series_activity_path(@series&.course, @series, @activity, {activity: {draft: false}}) : activity_path(@activity, {activity: {draft: false}}) %> - <%= link_to t("activities.show.alert_draft_edit"), edit_path, method: :put %> + + <% if @activity.ok? && @activity.correct_submission? && @activity.valid_config? %> + <%= link_to t("activities.show.alert_draft.edit"), edit_path, method: :put %> + <% else %> +
+ <%= t("activities.show.alert_draft.before_publish") %> +
+
+ > + +
+
+ > + +
+ <% if @activity.exercise? %> +
+ > + +
+ <% end %> +
+
+ <% end %> <% end %>
diff --git a/config/locales/views/activities/en.yml b/config/locales/views/activities/en.yml index 3233fcff3a..35e943c28c 100644 --- a/config/locales/views/activities/en.yml +++ b/config/locales/views/activities/en.yml @@ -101,8 +101,13 @@ en: preloaded_info: "We have preloaded your latest submission into the editor." preloaded_clear: Clear editor. preloaded_restore: Restore the initial code. - alert_draft_html: This activity is a draft and thus not visible for students. - alert_draft_edit: Publish activity. + alert_draft: + text_html: This activity is a draft and thus not visible for students. + edit: Publish activity. + before_publish: "Before you can publish this activity, the following conditions must be met:" + valid_config: "The JSON configuration must be valid." + is_valid: "The activity must have a name and a description." + correct_submission: "There must be at least one correct submission." series_activities_add_table: course_added_to_usable: "Adding this exercise will allow this course to use all of the private exercises in this exercise's repository. Are you sure?" edit: diff --git a/config/locales/views/activities/nl.yml b/config/locales/views/activities/nl.yml index e6c4ab7d75..44a6b99589 100644 --- a/config/locales/views/activities/nl.yml +++ b/config/locales/views/activities/nl.yml @@ -101,8 +101,13 @@ nl: preloaded_info: We hebben jouw laatste oplossing ingeladen in de editor. preloaded_clear: Maak de editor leeg. preloaded_restore: Zet de voorbeeldcode terug. - alert_draft_html: Deze oefening is nog een concept. Ze is niet zichtbaar voor studenten. - alert_draft_edit: Deze oefening publiceren. + alert_draft: + text_html: Deze oefening is nog een concept. Ze is niet zichtbaar voor studenten. + edit: Deze oefening publiceren. + before_publish: "Vooraleer je deze oefening kan publiceren, moet aan de volgende voorwaarden voldaan zijn:" + valid_config: "De JSON-configuratie moet geldig zijn." + is_valid: "De oefening moet een naam en een beschrijving hebben." + correct_submission: "Er moet minstens één correcte oplossing zijn." series_activities_add_table: course_added_to_usable: "Deze oefening toevoegen zal deze cursus toegang geven tot alle privé oefeningen in de repository van deze oefening. Ben je zeker?" edit: From b50dc59eef61b347e606a154b46a8c024e07cce9 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Wed, 31 Jan 2024 11:38:54 +0100 Subject: [PATCH 08/35] Fix test --- test/models/activity_test.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/models/activity_test.rb b/test/models/activity_test.rb index 36621c1f96..8a0fd4b9a0 100644 --- a/test/models/activity_test.rb +++ b/test/models/activity_test.rb @@ -305,11 +305,11 @@ class ActivityTest < ActiveSupport::TestCase assert_empty Activity.repository_scope(scope: :my_institution, user: create(:user, institution_id: nil)) end - test 'should have at least one valid submission before publishing' do + test 'should have at least one valid submission and a valid config before publishing' do activity = create :exercise, draft: true activity.update(draft: false) - assert_not_empty activity.errors + assert_equal 2, activity.errors.count assert_predicate activity.reload, :draft? # reset errors @@ -317,7 +317,19 @@ class ActivityTest < ActiveSupport::TestCase create :correct_submission, exercise: activity activity.update(draft: false) - assert_empty activity.errors - assert_not activity.reload.draft? + assert_equal 1, activity.errors.count + assert_predicate activity.reload, :draft? + + # reset errors + activity = Activity.find(activity.id) + stub_status(activity, 'ok') + # don't do config related checks as there is no config + activity.stubs(:check_memory_limit) + activity.stubs(:update_config) + + activity.update(draft: false) + + assert_equal 0, activity.errors.count + assert_not_predicate activity.reload, :draft? end end From 9ed58b9f2e0b5935c3d6040fc3caebb072a3fd07 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 1 Feb 2024 15:13:31 +0100 Subject: [PATCH 09/35] Update config/locales/views/activities/en.yml Co-authored-by: Bart Mesuere --- config/locales/views/activities/en.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/locales/views/activities/en.yml b/config/locales/views/activities/en.yml index 35e943c28c..782fa79ea0 100644 --- a/config/locales/views/activities/en.yml +++ b/config/locales/views/activities/en.yml @@ -102,12 +102,12 @@ en: preloaded_clear: Clear editor. preloaded_restore: Restore the initial code. alert_draft: - text_html: This activity is a draft and thus not visible for students. + text_html: This activity is currently a draft and is not yet visible to students. edit: Publish activity. - before_publish: "Before you can publish this activity, the following conditions must be met:" - valid_config: "The JSON configuration must be valid." + before_publish: "Before you can publish this activity, please ensure the following criteria are met:" + valid_config: "The exercise must have a valid configuration file." is_valid: "The activity must have a name and a description." - correct_submission: "There must be at least one correct submission." + correct_submission: "You must submit at least one correct solution." series_activities_add_table: course_added_to_usable: "Adding this exercise will allow this course to use all of the private exercises in this exercise's repository. Are you sure?" edit: From 70e2f218c02e1f9930f4930e0d2423324557de1a Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 1 Feb 2024 15:13:37 +0100 Subject: [PATCH 10/35] Update config/locales/views/activities/nl.yml Co-authored-by: Bart Mesuere --- config/locales/views/activities/nl.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/views/activities/nl.yml b/config/locales/views/activities/nl.yml index 44a6b99589..c0a03b2495 100644 --- a/config/locales/views/activities/nl.yml +++ b/config/locales/views/activities/nl.yml @@ -102,12 +102,12 @@ nl: preloaded_clear: Maak de editor leeg. preloaded_restore: Zet de voorbeeldcode terug. alert_draft: - text_html: Deze oefening is nog een concept. Ze is niet zichtbaar voor studenten. + text_html: Deze oefening is momenteel een concept en nog niet zichtbaar voor studenten. edit: Deze oefening publiceren. before_publish: "Vooraleer je deze oefening kan publiceren, moet aan de volgende voorwaarden voldaan zijn:" - valid_config: "De JSON-configuratie moet geldig zijn." + valid_config: "De oefening moet een geldig configuratiebestand hebben." is_valid: "De oefening moet een naam en een beschrijving hebben." - correct_submission: "Er moet minstens één correcte oplossing zijn." + correct_submission: "Je moet minstens één correcte oplossing indienen." series_activities_add_table: course_added_to_usable: "Deze oefening toevoegen zal deze cursus toegang geven tot alle privé oefeningen in de repository van deze oefening. Ben je zeker?" edit: From 4747c5a0a955b61ccd1a771538a4d67953929c8e Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 1 Feb 2024 15:16:29 +0100 Subject: [PATCH 11/35] Allign items --- app/views/activities/_draft_notice.html.erb | 2 +- config/locales/views/activities/en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/activities/_draft_notice.html.erb b/app/views/activities/_draft_notice.html.erb index 6ca367eaa1..4732a86eeb 100644 --- a/app/views/activities/_draft_notice.html.erb +++ b/app/views/activities/_draft_notice.html.erb @@ -11,7 +11,7 @@ <% if @activity.ok? && @activity.correct_submission? && @activity.valid_config? %> <%= link_to t("activities.show.alert_draft.edit"), edit_path, method: :put %> <% else %> -
+
<%= t("activities.show.alert_draft.before_publish") %>
diff --git a/config/locales/views/activities/en.yml b/config/locales/views/activities/en.yml index 782fa79ea0..0e38e6ddd4 100644 --- a/config/locales/views/activities/en.yml +++ b/config/locales/views/activities/en.yml @@ -106,7 +106,7 @@ en: edit: Publish activity. before_publish: "Before you can publish this activity, please ensure the following criteria are met:" valid_config: "The exercise must have a valid configuration file." - is_valid: "The activity must have a name and a description." + is_valid: "The exercise must have a name and a description." correct_submission: "You must submit at least one correct solution." series_activities_add_table: course_added_to_usable: "Adding this exercise will allow this course to use all of the private exercises in this exercise's repository. Are you sure?" From e5825deac7e2452e5ab7615c3e1aa844838ce3e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:42:29 +0000 Subject: [PATCH 12/35] Bump codecov/codecov-action from 3 to 4 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f995a47bbe..308823fbd1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,7 +50,7 @@ jobs: sudo sysctl -p bundle exec rails test - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} flags: rails @@ -72,7 +72,7 @@ jobs: run: | yarn test --ci --runInBand --coverage - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} flags: javascript @@ -131,7 +131,7 @@ jobs: run: | yarn test:system:coverage:merge - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} flags: system From c12df8a1dcd107f693710a246c97d64f83248e04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:42:37 +0000 Subject: [PATCH 13/35] Bump toolmantim/release-drafter from 5.25.0 to 6.0.0 Bumps [toolmantim/release-drafter](https://github.com/toolmantim/release-drafter) from 5.25.0 to 6.0.0. - [Release notes](https://github.com/toolmantim/release-drafter/releases) - [Commits](https://github.com/toolmantim/release-drafter/compare/v5.25.0...v6.0.0) --- updated-dependencies: - dependency-name: toolmantim/release-drafter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index a97ca878b4..ef4a5b670f 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -12,6 +12,6 @@ jobs: runs-on: ubuntu-latest steps: # Drafts next release notes as Pull Requests are merged into "main" - - uses: toolmantim/release-drafter@v5.25.0 + - uses: toolmantim/release-drafter@v6.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 29c5781113b0f2f67e792d120f0784c872318805 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:53:22 +0000 Subject: [PATCH 14/35] Bump diff-lcs from 1.5.0 to 1.5.1 Bumps [diff-lcs](https://github.com/halostatue/diff-lcs) from 1.5.0 to 1.5.1. - [Changelog](https://github.com/halostatue/diff-lcs/blob/main/History.md) - [Commits](https://github.com/halostatue/diff-lcs/commits) --- updated-dependencies: - dependency-name: diff-lcs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9f79874163..825a2eec24 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -170,7 +170,7 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.4.0) docker-api (2.2.0) excon (>= 0.47.0) From 065af2d21979cf53b6a00de07a6f44c0d766a869 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:53:46 +0000 Subject: [PATCH 15/35] Bump bootsnap from 1.17.1 to 1.18.3 Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.17.1 to 1.18.3. - [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md) - [Commits](https://github.com/Shopify/bootsnap/compare/v1.17.1...v1.18.3) --- updated-dependencies: - dependency-name: bootsnap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index dc24de0811..791e7780a7 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,7 @@ gem 'jbuilder', '~> 2.11.5' gem 'image_processing', '~> 1.12.2' # Reduces boot times through caching; required in config/boot.rb -gem 'bootsnap', '~> 1.17.1', require: false +gem 'bootsnap', '~> 1.18.3', require: false # used to validate container responses gem 'json_schemer', '~> 2.1.1' diff --git a/Gemfile.lock b/Gemfile.lock index 9f79874163..44c5f2fb8e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,7 +96,7 @@ GEM bigdecimal (3.1.6) bindata (2.4.15) bindex (0.8.1) - bootsnap (1.17.1) + bootsnap (1.18.3) msgpack (~> 1.2) builder (3.2.4) byebug (11.1.3) @@ -563,7 +563,7 @@ DEPENDENCIES annotate (~> 3.2.0) autoprefixer-rails (~> 10.4.16) bcrypt_pbkdf - bootsnap (~> 1.17.1) + bootsnap (~> 1.18.3) builder (~> 3.2.4) byebug (~> 11.1.3) capistrano-passenger (~> 0.2.1) From 574094a1107c3e0df9e5b2369a323e8c14f37270 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:54:02 +0000 Subject: [PATCH 16/35] Bump nokogiri from 1.16.0 to 1.16.2 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.0 to 1.16.2. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.16.0...v1.16.2) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index dc24de0811..820793ee0d 100644 --- a/Gemfile +++ b/Gemfile @@ -111,7 +111,7 @@ gem 'httparty', '~> 0.21.0' gem 'slack-notifier', '~> 2.4.0' # css styles for emails -gem 'nokogiri', '~> 1.16.0' +gem 'nokogiri', '~> 1.16.2' gem 'premailer-rails', '~> 1.12.0' # filtering diff --git a/Gemfile.lock b/Gemfile.lock index 9f79874163..e9fcaebe44 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -304,7 +304,7 @@ GEM net-protocol net-ssh (7.1.0) nio4r (2.7.0) - nokogiri (1.16.0-x86_64-linux) + nokogiri (1.16.2-x86_64-linux) racc (~> 1.4) oauth2 (2.0.8) faraday (>= 0.17.3, < 3.0) @@ -607,7 +607,7 @@ DEPENDENCIES minitest-utils (~> 0.4.8) mocha (~> 2.1.0) mysql2 (~> 0.5.5) - nokogiri (~> 1.16.0) + nokogiri (~> 1.16.2) omniauth-google-oauth2 (~> 1.1.1) omniauth-oauth2 (~> 1.8.0) omniauth-rails_csrf_protection (~> 1.0.1) From ec4957f6464aa8b209e72e3fd1bd7618c29ca33d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:55:26 +0000 Subject: [PATCH 17/35] Bump the codemirror group with 1 update Bumps the codemirror group with 1 update: [@codemirror/language](https://github.com/codemirror/language). Updates `@codemirror/language` from 6.10.0 to 6.10.1 - [Changelog](https://github.com/codemirror/language/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/language/compare/6.10.0...6.10.1) --- updated-dependencies: - dependency-name: "@codemirror/language" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: codemirror ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f48ee61945..f6aaab665d 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@babel/preset-env": "^7.23.9", "@codemirror/autocomplete": "^6.12.0", "@codemirror/commands": "^6.3.3", - "@codemirror/language": "^6.10.0", + "@codemirror/language": "^6.10.1", "@codemirror/language-data": "^6.4.0", "@codemirror/state": "^6.3.3", "@codemirror/view": "^6.23.1", diff --git a/yarn.lock b/yarn.lock index 70e3877b5a..e56305a74d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1241,10 +1241,10 @@ "@codemirror/language" "^6.0.0" "@codemirror/legacy-modes" "^6.1.0" -"@codemirror/language@^6.0.0", "@codemirror/language@^6.10.0", "@codemirror/language@^6.3.0", "@codemirror/language@^6.4.0", "@codemirror/language@^6.6.0", "@codemirror/language@^6.8.0", "@codemirror/language@^6.9.3": - version "6.10.0" - resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-6.10.0.tgz#2d0e818716825ee2ed0dacd04595eaa61bae8f23" - integrity sha512-2vaNn9aPGCRFKWcHPFksctzJ8yS5p7YoaT+jHpc0UGKzNuAIx4qy6R5wiqbP+heEEdyaABA582mNqSHzSoYdmg== +"@codemirror/language@^6.0.0", "@codemirror/language@^6.10.1", "@codemirror/language@^6.3.0", "@codemirror/language@^6.4.0", "@codemirror/language@^6.6.0", "@codemirror/language@^6.8.0", "@codemirror/language@^6.9.3": + version "6.10.1" + resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-6.10.1.tgz#428c932a158cb75942387acfe513c1ece1090b05" + integrity sha512-5GrXzrhq6k+gL5fjkAwt90nYDmjlzTIJV8THnxNFtNKWotMIlzzN+CpqxqwXOECnUdOndmSeWntVrVcv5axWRQ== dependencies: "@codemirror/state" "^6.0.0" "@codemirror/view" "^6.23.0" From f6107a8bf01ce1a1b56d546c9228b10a4e7e9ba8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:56:22 +0000 Subject: [PATCH 18/35] Bump webpack from 5.90.0 to 5.90.1 Bumps [webpack](https://github.com/webpack/webpack) from 5.90.0 to 5.90.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.90.0...v5.90.1) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f48ee61945..7aadd1ff74 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "tippy.js": "^6.3.7", "ts-loader": "^9.5.1", "typescript": "^5.3.3", - "webpack": "^5.90.0", + "webpack": "^5.90.1", "webpack-cli": "^5.1.4" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 70e3877b5a..706a979a9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8242,10 +8242,10 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.90.0: - version "5.90.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.90.0.tgz#313bfe16080d8b2fee6e29b6c986c0714ad4290e" - integrity sha512-bdmyXRCXeeNIePv6R6tGPyy20aUobw4Zy8r0LUS2EWO+U+Ke/gYDgsCh7bl5rB6jPpr4r0SZa6dPxBxLooDT3w== +webpack@^5.90.1: + version "5.90.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.90.1.tgz#62ab0c097d7cbe83d32523dbfbb645cdb7c3c01c" + integrity sha512-SstPdlAC5IvgFnhiRok8hqJo/+ArAbNv7rhU4fnWGHNVfN59HSQFaxZDSAL3IFG2YmqxuRs+IU33milSxbPlog== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^1.0.5" From c02a1e78c86763c1eb5e7ce5f93dd72e71b8ce0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:59:57 +0000 Subject: [PATCH 19/35] Bump lit from 3.1.1 to 3.1.2 Bumps [lit](https://github.com/lit/lit/tree/HEAD/packages/lit) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/lit/lit/releases) - [Changelog](https://github.com/lit/lit/blob/main/packages/lit/CHANGELOG.md) - [Commits](https://github.com/lit/lit/commits/lit@3.1.2/packages/lit) --- updated-dependencies: - dependency-name: lit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 63 ++++++++++++++++++++++------------------------------ 2 files changed, 28 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index f48ee61945..426f99e5b3 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "fscreen": "^1.2.0", "glightbox": "^3.2.0", "iframe-resizer": "^4.3.9", - "lit": "^3.1.1", + "lit": "^3.1.2", "node-polyglot": "^2.5.0", "sass": "^1.70.0", "tippy.js": "^6.3.7", diff --git a/yarn.lock b/yarn.lock index 70e3877b5a..9d2645c079 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1789,17 +1789,17 @@ "@lezer/highlight" "^1.0.0" "@lezer/lr" "^1.4.0" -"@lit-labs/ssr-dom-shim@^1.1.2", "@lit-labs/ssr-dom-shim@^1.1.2-pre.0": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.1.2.tgz#d693d972974a354034454ec1317eb6afd0b00312" - integrity sha512-jnOD+/+dSrfTWYfSXBXlo5l5f0q1UuJo3tkbMDCYA2lKUYq79jaxqtGEvnRoh049nt1vdo1+45RinipU6FGY2g== +"@lit-labs/ssr-dom-shim@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.0.tgz#353ce4a76c83fadec272ea5674ede767650762fd" + integrity sha512-yWJKmpGE6lUURKAaIltoPIE/wrbY3TEkqQt+X0m+7fQNnAv0keydnYvbiJFP1PnMhizmIWRWOG5KLhYyc/xl+g== -"@lit/reactive-element@^1.0.0 || ^2.0.0", "@lit/reactive-element@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-2.0.1.tgz#b17d8818d9c72ccc489f44e35d87cfa18a9c8c93" - integrity sha512-eu50SQXHRthFwWJMp0oAFg95Rvm6MTPjxSXWuvAu7It90WVFLFpNBoIno7XOXSDvVgTrtKnUV4OLJqys2Svn4g== +"@lit/reactive-element@^1.0.0 || ^2.0.0", "@lit/reactive-element@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-2.0.4.tgz#8f2ed950a848016383894a26180ff06c56ae001b" + integrity sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ== dependencies: - "@lit-labs/ssr-dom-shim" "^1.1.2" + "@lit-labs/ssr-dom-shim" "^1.2.0" "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -5984,39 +5984,30 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -lit-element@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-4.0.0.tgz#8343891bc9159a5fcb7f534914b37f2c0161e036" - integrity sha512-N6+f7XgusURHl69DUZU6sTBGlIN+9Ixfs3ykkNDfgfTkDYGGOWwHAYBhDqVswnFGyWgQYR2KiSpu4J76Kccs/A== +lit-element@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-4.0.4.tgz#e0b37ebbe2394bcb9578d611a409f49475dff361" + integrity sha512-98CvgulX6eCPs6TyAIQoJZBCQPo80rgXR+dVBs61cstJXqtI+USQZAbA4gFHh6L/mxBx9MrgPLHLsUgDUHAcCQ== dependencies: - "@lit-labs/ssr-dom-shim" "^1.1.2-pre.0" - "@lit/reactive-element" "^2.0.0" - lit-html "^3.0.0" + "@lit-labs/ssr-dom-shim" "^1.2.0" + "@lit/reactive-element" "^2.0.4" + lit-html "^3.1.2" -"lit-html@^2.0.0 || ^3.0.0", lit-html@^3.0.0, lit-html@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-3.1.0.tgz#a7b93dd682073f2e2029656f4e9cd91e8034c196" - integrity sha512-FwAjq3iNsaO6SOZXEIpeROlJLUlrbyMkn4iuv4f4u1H40Jw8wkeR/OUXZUHUoiYabGk8Y4Y0F/rgq+R4MrOLmA== +"lit-html@^2.0.0 || ^3.0.0", lit-html@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-3.1.2.tgz#6655ce82367472de7680c62b1bcb0beb0e426fa1" + integrity sha512-3OBZSUrPnAHoKJ9AMjRL/m01YJxQMf+TMHanNtTHG68ubjnZxK0RFl102DPzsw4mWnHibfZIBJm3LWCZ/LmMvg== dependencies: "@types/trusted-types" "^2.0.2" -"lit@^2.0.0 || ^3.0.0", lit@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lit/-/lit-3.1.1.tgz#49340c8875019a777cc83904f75a2bf7764617dc" - integrity sha512-hF1y4K58+Gqrz+aAPS0DNBwPqPrg6P04DuWK52eMkt/SM9Qe9keWLcFgRcEKOLuDlRZlDsDbNL37Vr7ew1VCuw== - dependencies: - "@lit/reactive-element" "^2.0.0" - lit-element "^4.0.0" - lit-html "^3.1.0" - -lit@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lit/-/lit-3.1.0.tgz#76429b85dc1f5169fed499a0f7e89e2e619010c9" - integrity sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w== +"lit@^2.0.0 || ^3.0.0", lit@^3.0.0, lit@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lit/-/lit-3.1.2.tgz#f276258e8a56593f1d834a5fd00a7eb5e891ae73" + integrity sha512-VZx5iAyMtX7CV4K8iTLdCkMaYZ7ipjJZ0JcSdJ0zIdGxxyurjIn7yuuSxNBD7QmjvcNJwr0JS4cAdAtsy7gZ6w== dependencies: - "@lit/reactive-element" "^2.0.0" - lit-element "^4.0.0" - lit-html "^3.1.0" + "@lit/reactive-element" "^2.0.4" + lit-element "^4.0.4" + lit-html "^3.1.2" loader-runner@^4.2.0: version "4.3.0" From 191f4598f8cebb388cb15e3a000bf840d54dae39 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 12 Feb 2024 11:48:08 +0100 Subject: [PATCH 20/35] Replace checkboxes with icons in draft notice --- .../stylesheets/models/activities.css.scss | 20 ------------------- app/views/activities/_draft_notice.html.erb | 20 +++++++++---------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/app/assets/stylesheets/models/activities.css.scss b/app/assets/stylesheets/models/activities.css.scss index 763037b87d..37d47c35e6 100644 --- a/app/assets/stylesheets/models/activities.css.scss +++ b/app/assets/stylesheets/models/activities.css.scss @@ -203,23 +203,3 @@ center img { background-color: var(--d-code-bg); } } - -.draft-notice { - .form-check-input[disabled] ~ .form-check-label, .form-check-input:disabled ~ .form-check-label { - opacity: 1; - } - - .form-check-input:disabled { - opacity: 1; - } - - .form-check-input:checked { - background-color: var(--d-warning); - border-color: var(--d-warning); - } - - .form-check-input { - background-color: transparent; - border-color: var(--d-warning); - } -} diff --git a/app/views/activities/_draft_notice.html.erb b/app/views/activities/_draft_notice.html.erb index 4732a86eeb..c592445450 100644 --- a/app/views/activities/_draft_notice.html.erb +++ b/app/views/activities/_draft_notice.html.erb @@ -13,19 +13,19 @@ <% else %>
<%= t("activities.show.alert_draft.before_publish") %> -
-
- > - +
+
+ "> + <%= t('activities.show.alert_draft.valid_config') %>
-
- > - +
+ "> + <%= t('activities.show.alert_draft.is_valid') %>
<% if @activity.exercise? %> -
- > - +
+ "> + <%= t('activities.show.alert_draft.correct_submission') %>
<% end %>
From 436a4fd5adb30548ce4a18890a812889b2d0d8bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:28:40 +0000 Subject: [PATCH 21/35] Bump webmock from 3.19.1 to 3.20.0 Bumps [webmock](https://github.com/bblimke/webmock) from 3.19.1 to 3.20.0. - [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md) - [Commits](https://github.com/bblimke/webmock/compare/v3.19.1...v3.20.0) --- updated-dependencies: - dependency-name: webmock dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e1f6a3de62..e69894f8c2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -134,7 +134,8 @@ GEM counter_culture (3.5.2) activerecord (>= 4.2) activesupport (>= 4.2) - crack (0.4.5) + crack (1.0.0) + bigdecimal rexml crass (1.0.6) css_parser (1.12.0) @@ -206,7 +207,7 @@ GEM has_scope (0.8.2) actionpack (>= 5.2) activesupport (>= 5.2) - hashdiff (1.0.1) + hashdiff (1.1.0) hashie (5.0.0) hcaptcha (7.1.0) json @@ -541,7 +542,7 @@ GEM activesupport faraday (~> 2.0) faraday-follow_redirects - webmock (3.19.1) + webmock (3.20.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) From 6b93d31586a381b57cf0ee40bfa2814b06cf78ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:28:59 +0000 Subject: [PATCH 22/35] Bump mysql2 from 0.5.5 to 0.5.6 Bumps [mysql2](https://github.com/brianmario/mysql2) from 0.5.5 to 0.5.6. - [Release notes](https://github.com/brianmario/mysql2/releases) - [Commits](https://github.com/brianmario/mysql2/compare/0.5.5...0.5.6) --- updated-dependencies: - dependency-name: mysql2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 87958aeb7f..16f23efc21 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ ruby '~> 3.1.2' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 7.1.3' # Use mysql as the database for Active Record -gem 'mysql2', '~> 0.5.5' +gem 'mysql2', '~> 0.5.6' # Use Puma as the app server gem 'puma', '~> 6.4.2' diff --git a/Gemfile.lock b/Gemfile.lock index e1f6a3de62..defd045459 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -290,7 +290,7 @@ GEM mustermann (3.0.0) ruby2_keywords (~> 0.0.1) mutex_m (0.2.0) - mysql2 (0.5.5) + mysql2 (0.5.6) net-imap (0.4.9.1) date net-protocol @@ -606,7 +606,7 @@ DEPENDENCIES minitest-ci (~> 3.4.0) minitest-utils (~> 0.4.8) mocha (~> 2.1.0) - mysql2 (~> 0.5.5) + mysql2 (~> 0.5.6) nokogiri (~> 1.16.2) omniauth-google-oauth2 (~> 1.1.1) omniauth-oauth2 (~> 1.8.0) From c70649df6115f58be70a2189f85ef65f51eea4a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:29:17 +0000 Subject: [PATCH 23/35] Bump after_commit_everywhere from 1.3.1 to 1.4.0 Bumps [after_commit_everywhere](https://github.com/Envek/after_commit_everywhere) from 1.3.1 to 1.4.0. - [Release notes](https://github.com/Envek/after_commit_everywhere/releases) - [Changelog](https://github.com/Envek/after_commit_everywhere/blob/master/CHANGELOG.md) - [Commits](https://github.com/Envek/after_commit_everywhere/compare/v1.3.1...v1.4.0) --- updated-dependencies: - dependency-name: after_commit_everywhere dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 87958aeb7f..ebef5a19f2 100644 --- a/Gemfile +++ b/Gemfile @@ -135,7 +135,7 @@ gem 'stackprof', '~> 0.2.26' gem 'ddtrace', '~> 1.19.0' # Make sure filesystem changes only happen at the end of a transaction -gem 'after_commit_everywhere', '~> 1.3.1' +gem 'after_commit_everywhere', '~> 1.4.0' # More advanced counter_cache that allows conditions gem 'counter_culture', '~> 3.5' diff --git a/Gemfile.lock b/Gemfile.lock index e1f6a3de62..b1557eb072 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,7 +78,7 @@ GEM addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) aes_key_wrap (1.1.0) - after_commit_everywhere (1.3.1) + after_commit_everywhere (1.4.0) activerecord (>= 4.2) activesupport airbrussh (1.4.1) @@ -277,7 +277,7 @@ GEM memory_profiler (1.0.1) mini_magick (4.11.0) mini_mime (1.1.5) - minitest (5.21.2) + minitest (5.22.2) minitest-ci (3.4.0) minitest (>= 5.0.6) minitest-utils (0.4.8) @@ -559,7 +559,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - after_commit_everywhere (~> 1.3.1) + after_commit_everywhere (~> 1.4.0) annotate (~> 3.2.0) autoprefixer-rails (~> 10.4.16) bcrypt_pbkdf From a564b31a85c3296989ec56905cfedbc1f179d423 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:29:39 +0000 Subject: [PATCH 24/35] Bump ddtrace from 1.19.0 to 1.20.0 Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 1.19.0 to 1.20.0. - [Release notes](https://github.com/DataDog/dd-trace-rb/releases) - [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md) - [Commits](https://github.com/DataDog/dd-trace-rb/compare/v1.19.0...v1.20.0) --- updated-dependencies: - dependency-name: ddtrace dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 87958aeb7f..bba74432de 100644 --- a/Gemfile +++ b/Gemfile @@ -132,7 +132,7 @@ gem 'memory_profiler', '~> 1.0.1' gem 'rack-mini-profiler', '~> 3.3.0' gem 'stackprof', '~> 0.2.26' -gem 'ddtrace', '~> 1.19.0' +gem 'ddtrace', '~> 1.20.0' # Make sure filesystem changes only happen at the end of a transaction gem 'after_commit_everywhere', '~> 1.3.1' diff --git a/Gemfile.lock b/Gemfile.lock index e1f6a3de62..2d2abe34ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -144,11 +144,11 @@ GEM daemons (1.4.1) dalli (3.2.7) base64 - datadog-ci (0.6.0) + datadog-ci (0.7.0) msgpack date (3.3.4) - ddtrace (1.19.0) - datadog-ci (~> 0.6.0) + ddtrace (1.20.0) + datadog-ci (~> 0.7.0) debase-ruby_core_source (= 3.3.1) libdatadog (~> 5.0.0.1.0) libddwaf (~> 1.14.0.0.0) @@ -575,7 +575,7 @@ DEPENDENCIES counter_culture (~> 3.5) cssbundling-rails (~> 1.4.0) dalli (~> 3.2.7) - ddtrace (~> 1.19.0) + ddtrace (~> 1.20.0) delayed_job_active_record (~> 4.1.8) delayed_job_web (~> 1.4.4) devise (~> 4.9.3) From ad818b04de373fc4e349bcbd9a768908aad69ef1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:34:46 +0000 Subject: [PATCH 25/35] Bump the codemirror group with 2 updates Bumps the codemirror group with 2 updates: [@codemirror/language-data](https://github.com/codemirror/language-data) and [@codemirror/view](https://github.com/codemirror/view). Updates `@codemirror/language-data` from 6.4.0 to 6.4.1 - [Changelog](https://github.com/codemirror/language-data/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/language-data/compare/6.4.0...6.4.1) Updates `@codemirror/view` from 6.23.1 to 6.24.0 - [Changelog](https://github.com/codemirror/view/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/view/compare/6.23.1...6.24.0) --- updated-dependencies: - dependency-name: "@codemirror/language-data" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: codemirror - dependency-name: "@codemirror/view" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: codemirror ... Signed-off-by: dependabot[bot] --- package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 62ae7ebd5a..144de695ed 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "@codemirror/autocomplete": "^6.12.0", "@codemirror/commands": "^6.3.3", "@codemirror/language": "^6.10.1", - "@codemirror/language-data": "^6.4.0", + "@codemirror/language-data": "^6.4.1", "@codemirror/state": "^6.3.3", - "@codemirror/view": "^6.23.1", + "@codemirror/view": "^6.24.0", "@dodona/papyros": "2.1.1", "@dodona/pyodide-trace-library": "^2.0.7", "@lezer/common": "^1.2.1", diff --git a/yarn.lock b/yarn.lock index 98bb3caf1c..fececae8d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1214,10 +1214,10 @@ "@lezer/common" "^1.2.0" "@lezer/yaml" "^1.0.0" -"@codemirror/language-data@^6.4.0": - version "6.4.0" - resolved "https://registry.yarnpkg.com/@codemirror/language-data/-/language-data-6.4.0.tgz#a71b88ab6d23949d3a168d669365bb0331d7f1c0" - integrity sha512-Wvup3FunHdkL782SUaA35e/cBKa/KEHKxRsrZtvcqTWDgULhrq5K44SnC5r4xYhBLuuxk9NLCAJU3desf+/2qQ== +"@codemirror/language-data@^6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@codemirror/language-data/-/language-data-6.4.1.tgz#7e217e12266c4581b452ce8f17d1b37c1e9838d3" + integrity sha512-NYhC3NvEMwUxSWS1sB5AePUtr5g2ASSYOZ37YixicDG8PWHslDV9mmXIX0KvmtEm50V8FT4F5i4HAsk/7i78LA== dependencies: "@codemirror/lang-angular" "^0.1.0" "@codemirror/lang-cpp" "^6.0.0" @@ -1293,10 +1293,10 @@ "@codemirror/view" "^6.0.0" "@lezer/highlight" "^1.0.0" -"@codemirror/view@^6.0.0", "@codemirror/view@^6.17.0", "@codemirror/view@^6.22.1", "@codemirror/view@^6.23.0", "@codemirror/view@^6.23.1": - version "6.23.1" - resolved "https://registry.yarnpkg.com/@codemirror/view/-/view-6.23.1.tgz#1ce3039a588d6b93f153b7c4c035c2075ede34a6" - integrity sha512-J2Xnn5lFYT1ZN/5ewEoMBCmLlL71lZ3mBdb7cUEuHhX2ESoSrNEucpsDXpX22EuTGm9LOgC9v4Z0wx+Ez8QmGA== +"@codemirror/view@^6.0.0", "@codemirror/view@^6.17.0", "@codemirror/view@^6.22.1", "@codemirror/view@^6.23.0", "@codemirror/view@^6.24.0": + version "6.24.0" + resolved "https://registry.yarnpkg.com/@codemirror/view/-/view-6.24.0.tgz#2f780290a54cfe571b1a1468c47b483de0cf6fb2" + integrity sha512-zK6m5pNkdhdJl8idPP1gA4N8JKTiSsOz8U/Iw+C1ChMwyLG7+MLiNXnH/wFuAk6KeGEe33/adOiAh5jMqee03w== dependencies: "@codemirror/state" "^6.4.0" style-mod "^4.1.0" From e84dcd9f7308020a03e112702b3ac397273555e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:35:59 +0000 Subject: [PATCH 26/35] Bump @types/serviceworker from 0.0.82 to 0.0.83 Bumps [@types/serviceworker](https://github.com/microsoft/TypeScript-DOM-Lib-Generator) from 0.0.82 to 0.0.83. - [Release notes](https://github.com/microsoft/TypeScript-DOM-Lib-Generator/releases) - [Commits](https://github.com/microsoft/TypeScript-DOM-Lib-Generator/compare/@types/serviceworker@0.0.82...@types/web@0.0.83) --- updated-dependencies: - dependency-name: "@types/serviceworker" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 62ae7ebd5a..a81b5175f2 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@types/iframe-resizer": "^3.5.13", "@types/jest": "^27.5.0", "@types/node-polyglot": "^2.5.0", - "@types/serviceworker": "^0.0.82", + "@types/serviceworker": "^0.0.83", "babel-loader": "^9.1.3", "babel-plugin-macros": "^3.1.0", "bootstrap": "5.3.2", diff --git a/yarn.lock b/yarn.lock index 98bb3caf1c..167e3b2fd5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2279,10 +2279,10 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.1.tgz#0480eeb7221eb9bc398ad7432c9d7e14b1a5a367" integrity sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg== -"@types/serviceworker@^0.0.82": - version "0.0.82" - resolved "https://registry.yarnpkg.com/@types/serviceworker/-/serviceworker-0.0.82.tgz#d46dd1a0b4be7c9dd0f4b201ccec59c42124e38c" - integrity sha512-JkHWXMbqUd8sAA8yUxEjabRqgm6yn/rjOY2VZeifryu72e/hbQW2MLsvpZvu8vwhkls8AGczw3U2MVKdnayqng== +"@types/serviceworker@^0.0.83": + version "0.0.83" + resolved "https://registry.yarnpkg.com/@types/serviceworker/-/serviceworker-0.0.83.tgz#728b9415207375c3d827b380dbdcb2ac7044a5ee" + integrity sha512-EwzwfDMIWyo0ulkbLm4KrnnHBSJ9PmnPQCk1nM3tmTMl9lTJsldx9ZGPq4J1ZD2yroMQ8vzUf7FNlWgvfpN/jw== "@types/stack-utils@^2.0.0": version "2.0.1" From 3071036aaa3af595b5b4ef497af090982de698dd Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 12 Feb 2024 15:12:49 +0100 Subject: [PATCH 27/35] Avoid duplicate series icon when favouriting a course --- app/assets/javascripts/favorite_course_buttons.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/favorite_course_buttons.ts b/app/assets/javascripts/favorite_course_buttons.ts index fd3f6c817b..086701b27f 100644 --- a/app/assets/javascripts/favorite_course_buttons.ts +++ b/app/assets/javascripts/favorite_course_buttons.ts @@ -1,6 +1,7 @@ import { Toast } from "./toast"; import { fetch, getParentByClassName } from "utilities"; import { i18n } from "i18n/i18n"; +import { SeriesIcon } from "components/series_icon"; function initFavoriteButtons(doc: Document | HTMLElement = document): void { function init(): void { @@ -44,6 +45,11 @@ function initFavoriteButtons(doc: Document | HTMLElement = document): void { cloneFavButton.setAttribute("title", i18n.t("js.unfavorite-course-do")); new bootstrap.Tooltip(cloneFavButton); // is enabled by default cloneFavButton.addEventListener("click", toggleFavorite); + // hack to fix double rendering of content of lit element 'd-series-icon' + clone.querySelectorAll("d-series-icon").forEach((el: SeriesIcon) => { + el.replaceChildren(); + el.requestUpdate(); + }); } else { new Toast(i18n.t("js.favorite-course-failed")); } From 46c97a01a83356562f2f10e2feb60a74e11789ea Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 12 Feb 2024 17:13:13 +0100 Subject: [PATCH 28/35] Make copy course button more prominent for featured courses --- app/views/courses/show.html.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 943874d5ab..98d753a237 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -53,10 +53,15 @@ <% if current_user&.member_of? @course or policy(@course).copy? or policy(@course).scoresheet? %>
+ <% if @course.featured? and policy(@course).copy? %> + <%= link_to new_course_url(copy_options: {base_id: @course.id}), class: "btn btn-filled with-icon" do %> + <%= t(".copy") %> + <% end %> + <% end %> <% if current_user&.member_of? @course %> <%= button_to t('.unsubscribe'), unsubscribe_course_path(@course), class: 'btn btn-text', data: {confirm: t('general.are_you_sure')} %> <% end %> - <% if policy(@course).copy? or policy(@course).scoresheet? or policy(@course).download_submissions? %> + <% if (!@course.featured? and policy(@course).copy?) or policy(@course).scoresheet? or policy(@course).download_submissions? %> From 7d35b22157499f1bab10b4fa95c6616eeb3c878c Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 12 Feb 2024 17:32:55 +0100 Subject: [PATCH 29/35] Add actual card --- app/views/courses/show.html.erb | 20 +++++++++++++------- config/locales/views/courses/en.yml | 1 + config/locales/views/courses/nl.yml | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 98d753a237..467aba97a0 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -32,7 +32,16 @@ <%= markdown(@course.description) %> <% end %>
- <% if current_user&.member_of?(@course).! %> + <% if @course.featured? and policy(@course).copy?%> +
+
+

<%= t(".copy_info_html") %>

+ <%= link_to new_course_url(copy_options: {base_id: @course.id}), class: "btn btn-filled with-icon" do %> + <%= t(".copy") %> + <% end %> +
+
+ <% elsif current_user&.member_of?(@course).! %> <%= render partial: 'not_a_member_card' %> <% if @lti_launch %> <%= render partial: 'not_a_member_dialog' %> @@ -53,15 +62,12 @@ <% if current_user&.member_of? @course or policy(@course).copy? or policy(@course).scoresheet? %>
- <% if @course.featured? and policy(@course).copy? %> - <%= link_to new_course_url(copy_options: {base_id: @course.id}), class: "btn btn-filled with-icon" do %> - <%= t(".copy") %> - <% end %> - <% end %> <% if current_user&.member_of? @course %> <%= button_to t('.unsubscribe'), unsubscribe_course_path(@course), class: 'btn btn-text', data: {confirm: t('general.are_you_sure')} %> + <% elsif @course.featured? and policy(@course).copy?%> + <%= registration_action_for course: @course, membership: @current_membership, secret: (@course.secret if @course.secret_required?(current_user)) %> <% end %> - <% if (!@course.featured? and policy(@course).copy?) or policy(@course).scoresheet? or policy(@course).download_submissions? %> + <% if policy(@course).copy? or policy(@course).scoresheet? or policy(@course).download_submissions? %> diff --git a/config/locales/views/courses/en.yml b/config/locales/views/courses/en.yml index 2b6dd39885..18ddbf1ae4 100644 --- a/config/locales/views/courses/en.yml +++ b/config/locales/views/courses/en.yml @@ -128,6 +128,7 @@ en: one: 1 pending user is rejected. other: "%{count} pending users are rejected." copy: "Copy this course" + copy_info_html: "Make a copy of this course to start using it with your own students. Have a look at our documentation to learn how to manage your own course." manage_series: "Manage series" download_deadlines: "Add course to calendar" download_deadlines_tooltip: "Add this link to your calendar application to show the course deadlines in your calendar" diff --git a/config/locales/views/courses/nl.yml b/config/locales/views/courses/nl.yml index 9999d02eb1..6626fb91b0 100644 --- a/config/locales/views/courses/nl.yml +++ b/config/locales/views/courses/nl.yml @@ -137,6 +137,7 @@ nl: one: 1 gebruiker op de wachtlijst is afgewezen. other: "%{count} gebruikers op de wachtlijst zijn afgewezen." copy: "Deze cursus kopiëren" + copy_info_html: "Wil je met je eigen studenten aan de slag met deze cursus? Maak dan je eigen kopie. In onze documentatie vind je meer informatie over het beheren van je eigen cursus." manage_series: "Reeksen beheren" download_deadlines: "Cursus toevoegen aan agenda" download_deadlines_tooltip: "Voeg deze link toe aan je agenda-applicatie om de deadlines van deze cursus in je kalender te zien" From 81d5ac29f3e778df3a374e36d63495b98ea19e36 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 12 Feb 2024 17:41:51 +0100 Subject: [PATCH 30/35] Fix layout when subscribed --- app/views/courses/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 467aba97a0..be243c0b48 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -27,12 +27,12 @@ <% if @course.description.present? or current_user&.member_of?(@course).! %>
-
+
<%= cache @course do %> <%= markdown(@course.description) %> <% end %>
- <% if @course.featured? and policy(@course).copy?%> + <% if @course.featured? && policy(@course).copy?%>

<%= t(".copy_info_html") %>

From b4e5e6957702f05fc5db2ea76121e8f5275d6a30 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 12 Feb 2024 17:48:10 +0100 Subject: [PATCH 31/35] Make register less prominent --- app/helpers/courses_helper.rb | 5 +++-- app/views/courses/show.html.erb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 34224957b3..af8c079dcd 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -5,6 +5,7 @@ def registration_action_for(**args) secret = args[:secret] membership = args[:membership] + css_class = args[:class] || 'btn btn-filled' if membership.nil? || membership.unsubscribed? if course.open_for_user?(current_user) || current_user.nil? @@ -13,13 +14,13 @@ def registration_action_for(**args) subscribe_course_path(@course, secret: secret), title: t('courses.registration.registration-tooltip'), method: :post, - class: 'btn btn-filled' + class: css_class else link_to t('courses.show.subscribe'), subscribe_course_path(@course, secret: secret), title: t('courses.registration.registration-tooltip'), method: :post, - class: 'btn btn-filled' + class: css_class end else tag.p t("courses.show.registration-#{@course.registration}-info", institution: @course.institution&.name) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index be243c0b48..271d4a490a 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -65,7 +65,7 @@ <% if current_user&.member_of? @course %> <%= button_to t('.unsubscribe'), unsubscribe_course_path(@course), class: 'btn btn-text', data: {confirm: t('general.are_you_sure')} %> <% elsif @course.featured? and policy(@course).copy?%> - <%= registration_action_for course: @course, membership: @current_membership, secret: (@course.secret if @course.secret_required?(current_user)) %> + <%= registration_action_for course: @course, membership: @current_membership, secret: (@course.secret if @course.secret_required?(current_user)), class: 'btn btn-text' %> <% end %> <% if policy(@course).copy? or policy(@course).scoresheet? or policy(@course).download_submissions? %> From f2e6dbb0e248266b8509a8b8f571310f12e5089c Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 12 Feb 2024 17:56:21 +0100 Subject: [PATCH 32/35] Update app/views/courses/show.html.erb Co-authored-by: Niko Strijbol --- app/views/courses/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 271d4a490a..a3bb7e9b66 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -32,7 +32,7 @@ <%= markdown(@course.description) %> <% end %>
- <% if @course.featured? && policy(@course).copy?%> + <% if @course.featured? && policy(@course).copy? %>

<%= t(".copy_info_html") %>

From b7b1d65812cdcce44bbe0f1330172476be70abf5 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 12 Feb 2024 17:56:26 +0100 Subject: [PATCH 33/35] Update app/views/courses/show.html.erb Co-authored-by: Niko Strijbol --- app/views/courses/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index a3bb7e9b66..8735a913bb 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -64,7 +64,7 @@
<% if current_user&.member_of? @course %> <%= button_to t('.unsubscribe'), unsubscribe_course_path(@course), class: 'btn btn-text', data: {confirm: t('general.are_you_sure')} %> - <% elsif @course.featured? and policy(@course).copy?%> + <% elsif @course.featured? and policy(@course).copy? %> <%= registration_action_for course: @course, membership: @current_membership, secret: (@course.secret if @course.secret_required?(current_user)), class: 'btn btn-text' %> <% end %> <% if policy(@course).copy? or policy(@course).scoresheet? or policy(@course).download_submissions? %> From ba21f082e1bb5adb8bcbc6ed595b14ead6fc77b0 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Tue, 13 Feb 2024 09:36:29 +0100 Subject: [PATCH 34/35] Update config/locales/views/courses/nl.yml Co-authored-by: Bart Mesuere --- config/locales/views/courses/nl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/views/courses/nl.yml b/config/locales/views/courses/nl.yml index 6626fb91b0..a461628040 100644 --- a/config/locales/views/courses/nl.yml +++ b/config/locales/views/courses/nl.yml @@ -137,7 +137,7 @@ nl: one: 1 gebruiker op de wachtlijst is afgewezen. other: "%{count} gebruikers op de wachtlijst zijn afgewezen." copy: "Deze cursus kopiëren" - copy_info_html: "Wil je met je eigen studenten aan de slag met deze cursus? Maak dan je eigen kopie. In onze documentatie vind je meer informatie over het beheren van je eigen cursus." + copy_info_html: "Wil je met aan de slag met deze cursus met jouw studenten? Maak dan je eigen kopie. Ontdek in onze documentatie hoe je jouw cursus moeiteloos kunt beheren." manage_series: "Reeksen beheren" download_deadlines: "Cursus toevoegen aan agenda" download_deadlines_tooltip: "Voeg deze link toe aan je agenda-applicatie om de deadlines van deze cursus in je kalender te zien" From 36a1c3be0ba80f418d43bca25102ac0959becea4 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Tue, 13 Feb 2024 09:40:29 +0100 Subject: [PATCH 35/35] Improve english text --- config/locales/views/courses/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/views/courses/en.yml b/config/locales/views/courses/en.yml index 18ddbf1ae4..610c2d329e 100644 --- a/config/locales/views/courses/en.yml +++ b/config/locales/views/courses/en.yml @@ -128,7 +128,7 @@ en: one: 1 pending user is rejected. other: "%{count} pending users are rejected." copy: "Copy this course" - copy_info_html: "Make a copy of this course to start using it with your own students. Have a look at our documentation to learn how to manage your own course." + copy_info_html: "Ready to bring this course to your students? Use the copy button to get started. Dive into our documentation to discover how to customize and manage your course effortlessly." manage_series: "Manage series" download_deadlines: "Add course to calendar" download_deadlines_tooltip: "Add this link to your calendar application to show the course deadlines in your calendar"