From 410d2f79d3ced9e85de85f8abe0719b31b248601 Mon Sep 17 00:00:00 2001 From: kiragrammel Date: Tue, 12 Sep 2023 22:52:38 +0200 Subject: [PATCH] Show link instead of Etherpad for new programming groups in Safari --- Gemfile | 1 + Gemfile.lock | 2 ++ app/views/programming_groups/new.html.slim | 6 +++++- config/locales/de.yml | 1 + config/locales/en.yml | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d9d0630b..9af38a7e 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,7 @@ source 'https://rubygems.org' gem 'bcrypt' gem 'bootstrap-will_paginate' +gem 'browser' gem 'carrierwave' gem 'charlock_holmes', require: 'charlock_holmes/string' gem 'docker-api', require: 'docker' diff --git a/Gemfile.lock b/Gemfile.lock index 3100bcf1..82e980be 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -87,6 +87,7 @@ GEM msgpack (~> 1.2) bootstrap-will_paginate (1.0.0) will_paginate + browser (5.3.1) builder (3.2.4) bunny (2.22.0) amq-protocol (~> 2.3, >= 2.3.1) @@ -534,6 +535,7 @@ DEPENDENCIES binding_of_caller bootsnap bootstrap-will_paginate + browser capybara carrierwave charlock_holmes diff --git a/app/views/programming_groups/new.html.slim b/app/views/programming_groups/new.html.slim index f7a0df59..b2fdb91e 100644 --- a/app/views/programming_groups/new.html.slim +++ b/app/views/programming_groups/new.html.slim @@ -21,6 +21,10 @@ h1 = t('programming_groups.new.create_programming_pair') h5 = t('programming_groups.new.find_partner_title') p = t('programming_groups.new.find_partner_description') - iframe name="embed_readwrite" src="https://etherpad.xopic.de/p/find_programming_group_for_exercise_#{@exercise.id}?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false" width="100%" height="300" style='border: 1px solid black;' + - if !browser.safari? + iframe name="embed_readwrite" src="https://etherpad.xopic.de/p/find_programming_group_for_exercise_#{@exercise.id}?userName=#{CGI.escape(current_user.displayname)}&showControls=false&showChat=false&showLineNumbers=true&useMonospaceFont=false" width="100%" height="300" style='border: 1px solid black;' + - else + == t('programming_groups.new.safari_not_supported', url: "https://etherpad.xopic.de/p/find_programming_group_for_exercise_#{@exercise.id}?userName=#{CGI.escape(current_user.displayname)}&showControls=false&showChat=false&showLineNumbers=true&useMonospaceFont=false") + = render('shared/modal', classes: 'modal-lg', id: 'modal-info-pair-programming', template: 'programming_groups/_info_pair_programming', title: t('programming_groups.new.pair_programming_info')) diff --git a/config/locales/de.yml b/config/locales/de.yml index e99e3d83..bea0d515 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -607,6 +607,7 @@ de: info_study: "Im Rahmen meiner Masterarbeit möchte ich das Anwenden von Pair Programming in diesem MOOC analysieren. Ich würde mich daher sehr darüber freuen, wenn ihr gemeinsam mit einer anderen Person die Aufgaben bearbeitet und mir anschließend euer Feedback in den Umfragen mitteilt. Bitte beachtet, dass es sich bei dieser Funktion um eine Beta-Version handelt, die bisher noch nicht für alle Nutzer:innen freigeschaltet wurde." own_user_id: "Deine Nutzer-ID:" pair_programming_info: Pair Programming Info + safari_not_supported: "Safari unterstützt nicht das Einbinden der Seite mit den Nutzer-IDs. Bitte klicke hier, um die Liste der Nutzer-IDs zu öffnen." work_alone: "Du kannst dich einmalig dafür entscheiden, die Aufgabe alleine zu bearbeiten. Anschließend kannst du jedoch nicht mehr in die Partnerarbeit für diese Aufgabe wechseln. Klicke hier, um die Aufgabe im Einzelmodus zu starten." implement: info_disconnected: Ihre Verbindung zum Server wurde unterbrochen. Bitte überprüfen Sie Ihre Internetverbindung und laden Sie die Seite erneut. diff --git a/config/locales/en.yml b/config/locales/en.yml index 0e3d5c59..aaa0ce93 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -607,6 +607,7 @@ en: info_study: "As part of my master's thesis, I would like to analyze the use of pair programming in this MOOC. Therefore, I would be very happy if you work on the exercises together with another person and then give me your feedback in the surveys. Please note that this feature is a beta version that has not yet been activated for all users." own_user_id: "Your user ID:" pair_programming_info: Pair Programming Info + safari_not_supported: "Safari does not support embedding the user IDs page. Please click here to open the list of user IDs." work_alone: "You can choose once to work on the exercise alone. Afterward, however, you will not be able to switch to work in a pair for this exercise. Click here to get to the exercise in single mode." implement: info_disconnected: You are disconnected from the server. Please check your internet connection and reload the page.