Commit 417c4cfc authored by Fabien Amarger's avatar Fabien Amarger
Browse files

[MLA] Add MLA norms (WIP)

There is no all fields handle for now.
parent 23779024
<div class="content container">
<img class="logo" src="https://spirhal.cri-association.fr/assets/SPIRHAL.png"/>
<img
class="logo"
src="https://spirhal.cri-association.fr/assets/SPIRHAL.png"
/>
<h1>
Interface de gestion des publications
</h1>
<h5 class="col-md-10 offset-md-1 text-justify">
Ce module permet d'homogénéiser vos références bibliographiques entre votre fiche annuaire (sur le site web de votre laboratoire) et vos documents hébergés sur HAL. Il s'agit ici de supprimer les doublons présents sur votre fiche annuaire et de compléter les <a href="https://fr.wikipedia.org/wiki/M%C3%A9tadonn%C3%A9e">métadonnées</a>, <b>c'est-à-dire les contenus</b> des champs manquants de vos documents hébergés sur HAL.
Ce module permet d'homogénéiser vos références bibliographiques entre votre
fiche annuaire (sur le site web de votre laboratoire) et vos documents
hébergés sur HAL. Il s'agit ici de supprimer les doublons présents sur votre
fiche annuaire et de compléter les
<a href="https://fr.wikipedia.org/wiki/M%C3%A9tadonn%C3%A9e">métadonnées</a
>, <b>c'est-à-dire les contenus</b> des champs manquants de vos documents
hébergés sur HAL.
</h5>
<div class="formLaboSelect">
<!-- <select [(ngModel)]="laboId">
<!-- <select [(ngModel)]="laboId">
<option value="-1">Selectionner un laboratoire</option>
<option [value]="i" *ngFor="let labo of labos; let i = index;">{{labo.name}}</option>
</select>
<button (click)="changeLabo()" *ngIf="laboId != selectedLaboId">
Charger
</button> -->
<div *ngIf="selectedLaboId == -1" class="col-md-8 offset-md-3">
<!-- <span *ngFor="let labo of labos; let i = index;" (click)="laboId = i; changeLabo()">
<!-- <span *ngFor="let labo of labos; let i = index;" (click)="laboId = i; changeLabo()">
<img [src]="labo.logo"/>
{{labo.name}}
</span> -->
<div class="row">
<div class="card col-md-3 selectable" *ngFor="let labo of labos; let i = index;" (click)="laboId = i; changeLabo()">
<div
class="card col-md-3 selectable"
*ngFor="let labo of labos; let i = index"
(click)="laboId = i; changeLabo()"
>
<div class="imgContainer">
<img class="card-img-top" [src]="labo.logo">
<img class="card-img-top" [src]="labo.logo" />
</div>
<div class="card-body">
<h4 class="card-title">{{labo.name}}</h4>
<!-- <button class="btn btn-primary" (click)="laboId = i; changeLabo()">Selectionner</button> -->
<h4 class="card-title">{{ labo.name }}</h4>
<!-- <button class="btn btn-primary" (click)="laboId = i; changeLabo()">Selectionner</button> -->
</div>
</div>
</div>
</div>
<div *ngIf="selectedLaboId > -1">
<div class="row">
<div class="card col-sm-6 offset-sm-3 col-md-4 offset-md-4">
<div class="imgContainer">
<img class="card-img-top" [src]="selectedLabo.logo">
<img class="card-img-top" [src]="selectedLabo.logo" />
</div>
<div class="card-body">
<h4 class="card-title">Laboratoire {{selectedLabo.name}}</h4>
<button class="btn btn-secondary btn-sm" (click)="laboId= -1; changeLabo()">Choisir un autre<br/> laboratoire</button>
<h4 class="card-title">Laboratoire {{ selectedLabo.name }}</h4>
<button
class="btn btn-secondary btn-sm"
(click)="laboId = -1; changeLabo()"
>
Choisir un autre<br />
laboratoire
</button>
</div>
</div>
</div>
......@@ -50,33 +68,47 @@
</div>
<div *ngIf="selectedLabo" class="researcherList text-centered">
<!-- <ul *ngIf="!researchersListLoading && selectedLabo.researchers">
<!-- <ul *ngIf="!researchersListLoading && selectedLabo.researchers">
<li *ngFor="let researcher of selectedLabo.researchers" (click)="selectResearcher(researcher.valName);">{{researcher.dispName}}</li>
</ul> -->
<div class="researchersComboBox row col-md-10" *ngIf="!researchersListLoading && selectedLabo.researchers">
<span class="col-md-5 offset-md-1">Choisir parmi les membres du laboratoire : </span>
<div class="col-md-6">
<jqxComboBox #myComboBox
*ngIf="!preSelected"
searchMode="containsignorecase"
(onChange)="comboBoxOnChange()"
[source]="selectedLabo.researchers"
[multiSelect]="true"
[displayMember]="'originalName'"
[valueMember]="'originalName'"
[theme]="'energyblue'"
[width]="180" >
<div
class="researchersComboBox row col-md-10"
*ngIf="!researchersListLoading && selectedLabo.researchers"
>
<span class="col-md-5 offset-md-1"
>Choisir parmi les membres du laboratoire :
</span>
<div class="col-md-6">
<jqxComboBox
#myComboBox
*ngIf="!preSelected"
searchMode="containsignorecase"
(onChange)="comboBoxOnChange()"
[source]="selectedLabo.researchers"
[multiSelect]="true"
[displayMember]="'originalName'"
[valueMember]="'originalName'"
[theme]="'energyblue'"
[width]="180"
>
</jqxComboBox>
<span class="badge" *ngIf="preSelected"><h5>{{preSelected}}</h5></span>
<span class="badge" *ngIf="preSelected"
><h5>{{ preSelected }}</h5></span
>
<button class="btn btn-dark" (click)="clearResearchersList()">
X
</button>
<button class="btn btn-dark" (click)="selectAllResearchers()" *ngIf="!allSelected">
<button
class="btn btn-dark"
(click)="selectAllResearchers()"
*ngIf="!allSelected"
>
Tous
</button>
</div>
<div class="col-md-5 offset-md-1">
Choisir le style correspondant à votre laboratoire (pour {{selectedLabo.name}} choisir {{selectedLabo.norm}}) :
Choisir le style correspondant à votre laboratoire (pour
{{ selectedLabo.name }} choisir {{ selectedLabo.norm }}) :
</div>
<div>
<div class="col-md-6">
......@@ -84,32 +116,69 @@
<option value="default">Défaut</option>
<option value="EHESS">EHESS</option>
<option value="APA">APA</option>
<option value="MLA">MLA</option>
</select>
</div>
</div>
<button class="col-md-6 btn btn-primary btn-sm sendAllButton" *ngIf="selectedResearchers && selectedResearchers.length> 1 && nbComputed >= selectedResearchers.length" (click)="sendMailAll()">
<button
class="col-md-6 btn btn-primary btn-sm sendAllButton"
*ngIf="
selectedResearchers &&
selectedResearchers.length > 1 &&
nbComputed >= selectedResearchers.length
"
(click)="sendMailAll()"
>
Envoyer un mail à tous les membres sélectionnés
</button>
</div>
<img src="https://spirhal.cri-association.fr/assets/ajax-loader.png" *ngIf="researchersListLoading"/>
<img
src="https://spirhal.cri-association.fr/assets/ajax-loader.png"
*ngIf="researchersListLoading"
/>
</div>
<div *ngIf="selectedResearchers && !normChanging" class="publiList-researchers" [hidden]="selectedResearchers && selectedResearchers.length > 1 && nbComputed < selectedResearchers.length">
<spirhal-publiList *ngFor="let res of selectedResearchers"
[researcherName]="res.name.valName"
[norm]="norm"
[structId]="selectedLabo.struct_id"
admin="true"
[pageUrl]="res.href"
[displayList]="selectedResearchers.length == 1"
[researcher]="res"
(detailsComputed)="detailsComputed($event)"
(sendMail)="sendMail($event)">
<div
*ngIf="selectedResearchers && !normChanging"
class="publiList-researchers"
[hidden]="
selectedResearchers &&
selectedResearchers.length > 1 &&
nbComputed < selectedResearchers.length
"
>
<spirhal-publiList
*ngFor="let res of selectedResearchers"
[researcherName]="res.name.valName"
[norm]="norm"
[structId]="selectedLabo.struct_id"
admin="true"
[pageUrl]="res.href"
[displayList]="selectedResearchers.length == 1"
[researcher]="res"
(detailsComputed)="detailsComputed($event)"
(sendMail)="sendMail($event)"
>
</spirhal-publiList>
</div>
<div *ngIf="selectedResearchers && selectedResearchers.length > 1 && nbComputed < selectedResearchers.length" class="publiList-researchers col-md-10">
<ngb-progressbar type="info" [max]="selectedResearchers.length" [value]="nbComputed" [striped]="true" [animated]="true"> (<i>{{nbComputed}} / {{selectedResearchers.length}}</i>)</ngb-progressbar>
<div
*ngIf="
selectedResearchers &&
selectedResearchers.length > 1 &&
nbComputed < selectedResearchers.length
"
class="publiList-researchers col-md-10"
>
<ngb-progressbar
type="info"
[max]="selectedResearchers.length"
[value]="nbComputed"
[striped]="true"
[animated]="true"
>
(<i>{{ nbComputed }} / {{ selectedResearchers.length }}</i
>)</ngb-progressbar
>
</div>
</div>
<!-- <div class="row-citation"> -->
<div class="citation MLA">
<a href="{{ publi.uri_s }}">
<span class="title" *ngIf="publi.title_s && type === 'DOUV'"
>/{{ publi.title_s }}/.
</span>
<span class="author" *ngIf="publi.authLastName_s">
<span *ngIf="publi.authLastName_s.length <= 4">
<span *ngFor="let val of publi.authLastName_s; index as i">
{{ publi.authLastName_s[i] }}, {{ publi.authFirstName_s[i] }}.
</span>
</span>
<span *ngIf="publi.authLastName_s.length > 4">
{{ publi.authLastName_s[0] }}, {{ publi.authFirstName_s[0] }} et al.
</span>
</span>
<span
class="title"
*ngIf="publi.title_s && type !== 'DOUV' && type !== 'OUV'"
>"{{ publi.title_s }}"
</span>
<span class="title" *ngIf="type === 'OUV' && publi.title_s">
/
{{ publi.title_s }}
<span *ngIf="publi.subTitle_s"> : {{ publi.subTitle_s }} </span>
/.
</span>
<span *ngIf="type === 'COUV' && publi.bookTitle_s">
/{{ publi.bookTitle_s }}/.
</span>
<span
*ngIf="(type === 'COUV' || type === 'DOUV') && publi.scientificEditor_s"
>
{{ publi.scientificEditor_s }}.
</span>
<span *ngIf="type === 'OUV' || type === 'DOUV' || type === 'COUV'">
<span *ngIf="publi.publicationLocation_s">{{
publi.publicationLocation_s
}}</span>
<span *ngIf="publi.publicationLocation_s && publi.publisher_s">
:
</span>
<span *ngIf="publi.publisher_s">{{ publi.publisher_s }}</span>
<span *ngIf="publi.producedDateY_i">, {{ publi.producedDateY_i }}. </span>
<span *ngIf="type === 'COUV' && publi.page_s">{{ publi.page_s }}. </span>
<span *ngIf="!publi.inPress_bool">Imprimé.</span>
</span>
</a>
</div>
<!-- <a class='picto-fulltext' target="__blank" [href]="publi.files_s[0]" *ngIf="publi.files_s && publi.files_s.length > 0"><img src='assets/picto-article.png' width='30'/></a>
</div> -->
import {
Component,
Input,
Output,
EventEmitter,
AfterViewInit,
} from "@angular/core";
@Component({
selector: "mla",
templateUrl: "./mla.norms.component.html",
styleUrls: ["./mla.norms.component.css"],
providers: [],
})
export class MLAComponent {
@Input() publi: any;
@Input() type: string;
tempType: string;
@Output() computeDetails = new EventEmitter();
constructor() {}
checkValue(key, text, avoidTag = false) {
if (!this.publi[key]) {
if (!avoidTag && this.publi.tags.indexOf(text) == -1) {
this.publi.tags.push(text);
}
} else {
if (this.publi[key] instanceof Array) {
this.publi[key] = this.publi[key][0];
}
}
}
displayPage(page) {
if (page.indexOf("-") != -1) {
return "p. " + page;
} else {
return page + " p.";
}
}
ngAfterViewInit() {
setTimeout(() => {
let types = ["OUV", "COUV", "ART", "COMM", "DOUV"];
this.tempType = this.type;
if (types.indexOf(this.type) == -1) {
this.type = "DEFAULT";
}
if (!this.publi.tags) {
this.publi.tags = [];
}
if (this.type == "OUV") {
this.checkValue("title_s", "Titre");
this.checkValue("producedDateY_i", "Date");
this.checkValue("publicationLocation_s", "Lieu de publication");
this.checkValue("publisher_s", "Editeur");
}
if (this.type == "DOUV") {
this.checkValue("title_s", "Titre");
this.checkValue("producedDateY_i", "Date");
if (this.publi.journalTitle_s) {
this.checkValue("producedDateY_i", "Date");
this.checkValue("journalTitle_s", "Titre du journal");
this.checkValue("volume_s", "Volume");
this.checkValue("issue_s", "Numéro");
} else if (this.publi.bookTitle_s) {
this.checkValue("scientificEditor_s", "Editeur scientifique");
this.checkValue("bookTitle_s", "Titre de l'ouvrage");
this.checkValue("publisher_s", "Editeur commercial");
this.checkValue("page_s", "Pages");
this.checkValue("publicationLocation_s", "Lieu de publication");
} else {
this.checkValue("publicationLocation_s", "Lieu de publication");
this.checkValue("publisher_s", "Editeur commercial");
this.checkValue("page_s", "Pages");
}
}
if (this.type == "DEFAULT") {
this.checkValue("title_s", "Titre", true);
this.checkValue("producedDateY_i", "Date", true);
this.checkValue("publicationLocation_s", "Lieu de publication", true);
this.checkValue("publisher_s", "Editeur", true);
} else if (this.type == "COUV") {
this.checkValue("title_s", "Titre");
this.checkValue("producedDateY_i", "Date");
this.checkValue("scientificEditor_s", "Editeur scientifique");
this.checkValue("bookTitle_s", "Titre de l'ouvrage");
this.checkValue("publisher_s", "Editeur commercial");
this.checkValue("page_s", "Pages");
this.checkValue("publicationLocation_s", "Lieu de publication");
} else if (this.type == "ART") {
this.checkValue("title_s", "Titre");
this.checkValue("producedDateY_i", "Date");
this.checkValue("journalTitle_s", "Titre du journal");
this.checkValue("volume_s", "Volume");
this.checkValue("issue_s", "Numéro");
this.checkValue("page_s", "Pages");
} else if (this.type == "COMM") {
this.checkValue("title_s", "Titre");
this.checkValue("producedDateY_i", "Date");
this.checkValue("conferenceTitle_s", "Nom de la conférence");
this.checkValue("city_s", "Ville");
this.checkValue("publisher_s", "Editeur");
this.checkValue("page_s", "Pages");
} else if (this.type == "POSTER") {
this.checkValue("title_s", "Titre");
this.checkValue("producedDateY_i", "Date");
this.checkValue("conferenceTitle_s", "Nom de la conférence");
this.checkValue("city_s", "Ville");
this.checkValue("publisher_s", "Editeur");
} else if (this.type == "THESE" || this.type == "HDR") {
this.checkValue("title_s", "Titre");
this.checkValue("producedDateY_i", "Date");
this.checkValue("authorityInstitution_s", "Institution");
}
this.computeDetails.emit();
});
}
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import {HttpClientModule} from '@angular/common/http';
import { HttpClientModule } from "@angular/common/http";
import {PubliListCmp } from './components/PubliList/PubliList.component';
import { EHESSComponent } from './components/norms/ehess/ehess.norms.component';
import { APAComponent } from './components/norms/apa/apa.norms.component';
import { DefaultNormComponent } from './components/norms/default/default.norms.component';
import { PubliListCmp } from "./components/PubliList/PubliList.component";
import { EHESSComponent } from "./components/norms/ehess/ehess.norms.component";
import { APAComponent } from "./components/norms/apa/apa.norms.component";
import { MLAComponent } from "./components/norms/mla/mla.norms.component";
import { DefaultNormComponent } from "./components/norms/default/default.norms.component";
import {NgbdModalContent} from './components/customModal.component';
import { AngularFontAwesomeModule } from 'angular-font-awesome';
import { NgbdModalContent } from "./components/customModal.component";
import { AngularFontAwesomeModule } from "angular-font-awesome";
@NgModule({
declarations: [
PubliListCmp,
EHESSComponent,
APAComponent,
MLAComponent,
DefaultNormComponent,
NgbdModalContent
NgbdModalContent,
],
imports: [
BrowserModule,
HttpClientModule,
AngularFontAwesomeModule,
NgbModule.forRoot()
NgbModule.forRoot(),
],
providers: [],
bootstrap: [PubliListCmp],
entryComponents: [NgbdModalContent],
exports: [PubliListCmp]
exports: [PubliListCmp],
})
export class SpirHALModule { }
export class SpirHALModule {}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment