From 52501616e4703086445d29a28156c785da6d532c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Arag=C3=B3n?= Date: Thu, 28 May 2020 20:22:46 -0500 Subject: [PATCH] color meet --- plugin/googlemeet/lang/spanish.php | 2 ++ plugin/googlemeet/meets.php | 25 ++++++++++++++++++- plugin/googlemeet/resources/css/style.css | 18 ++++++++++--- .../src/googlemeet_plugin.class.php | 15 ++++------- plugin/googlemeet/view/start.tpl | 9 ++++--- 5 files changed, 51 insertions(+), 18 deletions(-) diff --git a/plugin/googlemeet/lang/spanish.php b/plugin/googlemeet/lang/spanish.php index 2af3f87185..eca0f621c3 100644 --- a/plugin/googlemeet/lang/spanish.php +++ b/plugin/googlemeet/lang/spanish.php @@ -20,5 +20,7 @@ $strings['InstantMeetURLHelp'] = "Es la URL para iniciar una reunión instantán $strings['AccessMeeting'] = "Accede a la reunión"; $strings['MeetingDescription'] = "Descripción"; $strings['MeetingDescriptionHelp'] = "(Opcional) Añade una breve descripción sobre la reunión."; +$strings['MeetColor'] = "Color Meet"; +$strings['MeetColorHelp'] = "(Opcional)"; diff --git a/plugin/googlemeet/meets.php b/plugin/googlemeet/meets.php index b746610342..393dbb9fe5 100644 --- a/plugin/googlemeet/meets.php +++ b/plugin/googlemeet/meets.php @@ -76,6 +76,22 @@ if ($enable) { ] ); + try { + $form->addElement( + 'color', + 'meet_color', + [ + $plugin->get_lang('MeetColor'), + $plugin->get_lang('MeetColorHelp'), + ], + [ + 'value' => '#1CC88A' + ] + ); + } catch (HTML_QuickForm_Error $e) { + echo $e; + } + $form->addHtmlEditor( 'meet_description', [ @@ -150,7 +166,14 @@ if ($enable) { 'title' => $plugin->get_lang('InstantMeetURLHelp'), ] ); - + $form->addElement( + 'color', + 'meet_color', + [ + $plugin->get_lang('MeetColor'), + $plugin->get_lang('MeetColorHelp') + ] + ); $form->addHtmlEditor( 'meet_description', [ diff --git a/plugin/googlemeet/resources/css/style.css b/plugin/googlemeet/resources/css/style.css index 068c129efc..b540332412 100644 --- a/plugin/googlemeet/resources/css/style.css +++ b/plugin/googlemeet/resources/css/style.css @@ -26,6 +26,9 @@ border: 0; box-shadow: 0 0 2rem 0 rgba(136,152,170,.15); } +.card-meet:hover{ + border-left: .25rem solid #cdcdcd !important; +} .card-meet .card-body { padding: 1rem 1.5rem; } @@ -72,9 +75,7 @@ align-items: center; justify-content: center; } -.bg-gradient-green { - background: linear-gradient(87deg,#2dce89 0,#2dcecc 100%)!important; -} + .text-white { color: #fff!important; } @@ -95,4 +96,15 @@ } .float-right { float: right; +} +.btn-add-meet{ + color: #fff; + border-color: #1cc88a; + background-color: #1cc88a; + font-weight: bold; +} +.btn-add-meet:hover { + color: #fff; + border-color: #17a673; + background-color: #169b6b; } \ No newline at end of file diff --git a/plugin/googlemeet/src/googlemeet_plugin.class.php b/plugin/googlemeet/src/googlemeet_plugin.class.php index b7fbdb4871..5e2b11b902 100644 --- a/plugin/googlemeet/src/googlemeet_plugin.class.php +++ b/plugin/googlemeet/src/googlemeet_plugin.class.php @@ -9,8 +9,6 @@ class GoogleMeetPlugin extends Plugin { - - const TABLE_MEET_COURSES = 'plugin_meet_courses'; const TABLE_MEET_LIST = 'plugin_meet_room'; const SETTING_TITLE = 'tool_title'; const SETTING_ENABLED = 'google_meet_enabled'; @@ -67,8 +65,8 @@ class GoogleMeetPlugin extends Plugin meet_name VARCHAR(250) NULL, meet_url VARCHAR(250) NULL, meet_description VARCHAR(250) NULL, + meet_color VARCHAR(7) NULL, type_meet INT NOT NULL, - user_id INT NULL NOT NULL, cd_id INT NULL NOT NULL, start_time DATETIME NULL, end_time DATETIME NULL, @@ -95,7 +93,6 @@ class GoogleMeetPlugin extends Plugin $this->deleteCourseToolLinks(); $tablesToBeDeleted = [ - self::TABLE_MEET_COURSES, self::TABLE_MEET_LIST, ]; @@ -144,14 +141,13 @@ class GoogleMeetPlugin extends Plugin $table = Database::get_main_table(self::TABLE_MEET_LIST); $idCourse = api_get_course_int_id(); - $idUser = api_get_user_id(); $params = [ 'meet_name' => $values['meet_name'], 'meet_url' => $values['meet_url'], 'type_meet' => $values['type_meet'], 'meet_description' => $values['meet_description'], - 'user_id' => $idUser, + 'meet_color' => $values['meet_color'], 'cd_id' => $idCourse, 'start_time' => null, 'end_time' => null, @@ -202,8 +198,8 @@ class GoogleMeetPlugin extends Plugin 'meet_name' => $row['meet_name'], 'meet_url' => $row['meet_url'], 'meet_description' => $row['meet_description'], + 'meet_color' => $row['meet_color'], 'type_meet' => $row['type_meet'], - 'user_id' => $row['user_id'], 'cd_id' => $row['cd_id'], 'start_time' => $row['start_time'], 'end_time' => $row['end_time'], @@ -234,8 +230,8 @@ class GoogleMeetPlugin extends Plugin 'meet_name' => $row['meet_name'], 'meet_url' => $row['meet_url'], 'meet_description' => $row['meet_description'], + 'meet_color' => $row['meet_color'], 'type_meet' => $row['type_meet'], - 'user_id' => $row['user_id'], 'cd_id' => $row['cd_id'], 'start_time' => $row['start_time'], 'end_time' => $row['end_time'], @@ -254,14 +250,13 @@ class GoogleMeetPlugin extends Plugin $table = Database::get_main_table(self::TABLE_MEET_LIST); $idCourse = api_get_course_int_id(); - $idUser = api_get_user_id(); $params = [ 'meet_name' => $values['meet_name'], 'meet_url' => $values['meet_url'], 'type_meet' => $values['type_meet'], 'meet_description' => $values['meet_description'], - 'user_id' => $idUser, + 'meet_color' => $values['meet_color'], 'cd_id' => $idCourse, 'start_time' => null, 'end_time' => null, diff --git a/plugin/googlemeet/view/start.tpl b/plugin/googlemeet/view/start.tpl index 4daea418b8..8eac5b8d4e 100644 --- a/plugin/googlemeet/view/start.tpl +++ b/plugin/googlemeet/view/start.tpl @@ -8,7 +8,7 @@
{% if is_admin or is_teacher %} - + {{ 'ManageMeetAccounts'|get_plugin_lang('GoogleMeetPlugin') }} @@ -20,11 +20,11 @@ {% for meet in meets %}
-
+
-
+
@@ -38,17 +38,18 @@
+ {% if is_admin or is_teacher %} + {% endif %}