From a4645d07a83711b928d96b2be8425b4d3541a056 Mon Sep 17 00:00:00 2001
From: Myriam Delaruelle
 <Myriam Delaruelle@bdn-un-mdelarue.ad.univ-lorraine.fr>
Date: Tue, 5 Oct 2021 08:51:38 +0200
Subject: [PATCH] icones format hybride

---
 lang/fr/format_iena.php     |  4 ++--
 renderer.php                |  8 ++++++--
 styles.css                  | 31 ++++++++++++++++++++++++++++++-
 templates/section.mustache  |  7 ++++++-
 templates/sections.mustache |  4 ++++
 5 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/lang/fr/format_iena.php b/lang/fr/format_iena.php
index 9b91dc4..5776a44 100644
--- a/lang/fr/format_iena.php
+++ b/lang/fr/format_iena.php
@@ -31,7 +31,7 @@
 	$string['editsection'] = 'Modifier section';
 	$string['deletesection'] = 'Supprimer section';
 	$string['sectionname'] = 'Section';
-	$string['section0name'] = 'General';
+	$string['section0name'] = 'Général';
 	$string['hidefromothers'] = 'Cacher section';
 	$string['showfromothers'] = 'Voir section';
 	$string['showdefaultsectionname'] = 'Show the default sections name';
@@ -47,7 +47,7 @@ By definition an unnamed section is displayed as <strong>section [N]</strong>.';
 	$string['notif'] = 'Notification';
 	$string['notif_summary'] = 'Une notification peut être envoyée à l étudiant par mail. Elle lui rapplera de consulter la section et contiendra diverses informations (nom du cours, lien vers le cours, nom de la section, date le la section et modalité';
 	$string['in_presence'] = 'En présence';
-	$string['not_presence'] = 'A distance';
+	$string['not_presence'] = 'À distance';
 	$string['days_before'] = 'Un certain nombre de jours avant la séance';
 	$string['days_after'] = 'Un certain nombre de jours après la séance';
 	$string['days_same'] = 'Le jour même';
diff --git a/renderer.php b/renderer.php
index 093b7ea..bc665d1 100644
--- a/renderer.php
+++ b/renderer.php
@@ -181,14 +181,18 @@ class format_iena_renderer extends format_topics_renderer{
 
 				if (isset($param_section->presence)) {
 					if ($param_section->presence == 1) {
-						$section->presence = "En présence";
+						$section->presence = true;
+						$section->distance =false;
 						$string_date_presence="Le ";
 					} else if ($param_section->presence == 2) {
-						$section->presence = "À distance";
+						$section->presence = false;
+						$section->distance =true;
 						$string_date_presence="Pour le ";
 					}
 					else{
 						$string_date_presence="Le ";
+						$section->presence = false;
+						$section->distance =false;
 					}
 				}
 
diff --git a/styles.css b/styles.css
index 7e00b87..a2d6e50 100644
--- a/styles.css
+++ b/styles.css
@@ -304,7 +304,7 @@ ul.nav.navbar-nav.ml-auto {
 /* Bottom header */
 
 .iena-course-header-bottom {
-	margin-bottom: 0;
+	margin-bottom: 20px;
 }
 
 /* Toggler */
@@ -797,3 +797,32 @@ tbody th{
 	margin-bottom: 40px;
 }
 
+
+.iena-icon-distance, .iena-icon-presence{
+	content: "";
+	display: block;
+	color: white;
+}
+
+.iena-icon-presence::after{
+	content: "\f0c0";
+	font-family: FontAwesome; width: 100%; display: inline-block;text-align: center; 
+	color: black;
+	font-size: large;
+}
+
+.iena-icon-distance::after{
+	content: "\f108";
+	font-family: FontAwesome; width: 100%; display: inline-block;text-align: center; 
+	color: black;
+	font-size: large;
+}
+
+.iena-caption-sections > .iena-caption-icons, .iena-caption-sections > .iena-caption-icons > * {
+	display: inline-block;
+	
+}
+
+.iena-caption-sections > .iena-caption-icons{
+	margin-right: 20px;
+}
diff --git a/templates/section.mustache b/templates/section.mustache
index d0a53e4..e8cc33a 100644
--- a/templates/section.mustache
+++ b/templates/section.mustache
@@ -11,9 +11,14 @@
 			<div class="titre_section set_height">
 				{{#presence}}
 				<div class="label_item sect-date">
-					{{presence}}
+					<span class="iena-icon-presence" data-toggle="tooltip" data-placement="top" title="{{#str}} in_presence, format_iena {{/str}}"></span>
 				</div>
 				{{/presence}}
+				{{#distance}}
+				<div class="label_item sect-date">
+					<span class="iena-icon-distance" data-toggle="tooltip" data-placement="top" title="{{#str}} not_presence, format_iena {{/str}}"></span>
+				</div>
+				{{/distance}}
 				
 			</div>
 			<div class="right_info">
diff --git a/templates/sections.mustache b/templates/sections.mustache
index 9891eb5..3c5c342 100644
--- a/templates/sections.mustache
+++ b/templates/sections.mustache
@@ -1,6 +1,10 @@
 
 <ul class="iena-editing">
 	<div class="iena-course-header"></div>
+	<div class="iena-caption-sections">
+		<div class="iena-caption-icons"><span class="iena-icon-presence"></span>{{#str}} in_presence, format_iena {{/str}}</div>
+	 <div class="iena-caption-icons"><span class="iena-icon-distance"></span>{{#str}} not_presence, format_iena {{/str}}</div>
+	</div>
 	{{#sections}}
 		{{> format_iena/section}}
 	{{/sections}}
-- 
GitLab