diff --git a/ordre-du-jour/odj/src/app/app.component.html b/ordre-du-jour/odj/src/app/app.component.html index ed1121d0..de521a48 100644 --- a/ordre-du-jour/odj/src/app/app.component.html +++ b/ordre-du-jour/odj/src/app/app.component.html @@ -4,23 +4,84 @@
+ logo osm + Sujets:
    -
  • {{ i + 1 }}) {{ s.title }} -

    {{ s.duration }} min, par {{ s.author }}. Reste: {{ resteTopicMinutes }}. Passé: {{s.spentSeconds}}.

    +

    + {{ s.duration }} min, par {{ s.author }}. Reste: {{ resteTopicMinutes(s) }}. Passé: {{ round(s.spentSeconds) }}. +

    🎉

- -

- {{ (hints) }} +

+ +

+ notes +

+ +

+ Texte du pad +

+ +

+ Compte rendu +

+

+ {{buildCompteRendu()}}

+ + +
+ +

+ {{ (hints) }} +

-
- debug: -
-        {{ subjects|json }}
-      
-
+
diff --git a/ordre-du-jour/odj/src/app/app.component.ts b/ordre-du-jour/odj/src/app/app.component.ts index f0091d26..2055e4fa 100644 --- a/ordre-du-jour/odj/src/app/app.component.ts +++ b/ordre-du-jour/odj/src/app/app.component.ts @@ -7,6 +7,7 @@ import {FormsModule} from "@angular/forms"; interface Topic { id: number, // numéro du sujet title: string, // titre du sujet à aborder + notes: string, // titre du sujet à aborder duration: number, // nombre de minutes du sujet author: string,// auteur du sujet qui anime la discussion startDate: Date, // date de début du sujet @@ -26,26 +27,19 @@ export class AppComponent implements OnInit, OnDestroy { title = 'odj'; subjects: Array = []; currentSubjectId = 0; - // startTime: string = "20:30"; - startTime: string = "17:00"; + startTime: string = "20:30"; + // startTime: string = "17:00"; endTime: string = "22:00"; pasteLand: string = "* Présentation du suivi sur Nextcloud - 5min (tykayn)\n" + "* Réduction de bus factor - 5min (tykayn)\n" + "* Réunion avec Wikimedia France - 5min (tykayn)\n" + ""; - hints: string = " - le pad des notes de réunion https://annuel.framapad.org/p/N_IDAQXYLHswlpU2s3oE\n" + - "\t - canal spécial pour le SOTM fr sur telegram https://t.me/SOTM2023-Marseille\n" + - "\t - canal général sur telegram https://t.me/osm-fr\n" + - "\t - espace de canaux sur matrix https://app.element.io/#/room/#osmfr:matrix.org\n" + - "\t - le forum section CA https://forum.openstreetmap.fr/c/openstreetmap-france/ca/53\n" + - "\t - le github osm-france https://github.com/osm-fr/ \n" + - "\t - les réunions mensuelles du CA https://osmvideo.cloud68.co/user/fre-aux-yuh \n" + - "\t - le nextcloud osm https://nextcloud.openstreetmap.fr\n" + - "\t - les status des services en ligne https://stats.uptimerobot.com/mQX5Vi5YW2"; + statsExplication: string = '' - resteTopicMinutes: any = 10; - showDebug: boolean = false; + hints: string = ""; + + showDebug: boolean = true; private startDate: Date = new Date(); private endDate: Date = new Date(); private topicChangeDate: Date = new Date(); @@ -60,6 +54,12 @@ export class AppComponent implements OnInit, OnDestroy { this.subjects[this.currentSubjectId].spentSeconds += timeDifferenceInSeconds; this.topicChangeDate = currentTime; } + round(val:number){ + if (val < 60) { + return Math.round(val) +' s' + } + return (Math.round(val / 60) * 60) + ' min' + } parseTheListOfTopicsInPasteLand() { @@ -77,7 +77,10 @@ export class AppComponent implements OnInit, OnDestroy { id: ii, title: boom[0], duration: 15, + spentSeconds: 0, author: '', + notes: '', + finished: false, startDate: this.getStartDateAfterDuration(accumulatedDuration + ''), endDate: this.getEndDateAfterDuration(accumulatedDuration + ''), }) @@ -109,13 +112,13 @@ export class AppComponent implements OnInit, OnDestroy { * * @param {Topic} topic - The topic for which to compute the remaining time. */ - computeResteTopicMinutes(topic: Topic): void { + computeResteTopicMinutes(topic: Topic): number { let currentSubjectDuration = topic.duration; // The duration of the current subject, in minutes let currentSubjectStartTime = new Date(this.startTime); // The start time of the current subject let currentSubjectEndTime = new Date(currentSubjectStartTime.getTime() + currentSubjectDuration * 60000); // The end time of the current subject - let remainingTime = currentSubjectEndTime.getTime() - new Date().getTime(); // The remaining time, in milliseconds - this.resteTopicMinutes = Math.floor(remainingTime / 60000); // The remaining time, in minutes + return currentSubjectEndTime.getTime() - new Date().getTime(); // The remaining time, in milliseconds + } interval: any; @@ -185,6 +188,11 @@ export class AppComponent implements OnInit, OnDestroy { console.log('ajout au topic', this.currentSubjectId) } + resteTopicMinutes(topic: Topic) { + return this.round(topic.spentSeconds / topic.duration * 60) + ' min' + } + + convertTextToHTMLLinks(text: string): string { let urlRegex = /(https?:\/\/[^\s<]+[^<.,:;\"\'\]\s])(?!["\])\s])/g; let matches = urlRegex.exec(text); @@ -204,4 +212,58 @@ export class AppComponent implements OnInit, OnDestroy { this.updateTopicChangeDate() this.currentSubjectId < 1 ? this.currentSubjectId = 0 : this.currentSubjectId -= 1; } + + makeStatisticsOnTopicsSpentSeconds() { + let totalSeconds = 0; + for (const topic of this.subjects) { + totalSeconds += topic.spentSeconds; + } + + let averageSeconds = totalSeconds / this.subjects.length; + + let longestTopic = this.subjects[0]; + let longestSeconds = longestTopic.spentSeconds; + for (const topic of this.subjects) { + if (topic.spentSeconds > longestSeconds) { + longestSeconds = topic.spentSeconds; + longestTopic = topic; + } + } + + let shortestTopic = this.subjects[0]; + let shortestSeconds = shortestTopic.spentSeconds; + for (const topic of this.subjects) { + if (topic.spentSeconds < shortestSeconds) { + shortestSeconds = topic.spentSeconds; + shortestTopic = topic; + } + } + + + this.statsExplication = `Total spent seconds: ${totalSeconds}\nAverage spent seconds: ${averageSeconds}\nLongest topic: ${longestTopic.title} (${longestSeconds} seconds)\nShortest topic: ${shortestTopic.title} (${shortestSeconds} seconds)`; + } + + + setSubject(i: number) { + this.currentSubjectId = i; + this.updateTopicChangeDate() + } + + compteRendu:string = '' + + + buildCompteRendu(){ + let compteRendu = 'Compte rendu :\n\n'; + for (const topic of this.subjects) { + compteRendu += `Sujet ${topic.id + 1} : ${topic.title}\n`; + compteRendu += `Durée : ${topic.duration} minutes\n`; + compteRendu += `Temps écoulé : ${this.resteTopicMinutes(topic)}\n\n`; + } + this.compteRendu = compteRendu + return compteRendu + } + copyCompteRenduToClipboard() { + + navigator.clipboard.writeText(this.compteRendu); + } }