Skip to content

Commit

Permalink
Ajout d'une page de statistiques listant les questions les plus fréqu…
Browse files Browse the repository at this point in the history
…entes.
  • Loading branch information
NataliaJabinschi committed Sep 10, 2024
1 parent 07d85e4 commit 52a86f2
Show file tree
Hide file tree
Showing 22 changed files with 347 additions and 106 deletions.
9 changes: 7 additions & 2 deletions src/app/app-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ import { PROCESS_MODULE_PATH } from './process-page/process-page-routing.paths';
import { provideSubmissionState } from './submission/provide-submission-state';
import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-routing-paths';
import {AiSearchComponent} from "../themes/calypso/app/ai-search/ai-search.component";
import {PagesComponent} from "../themes/calypso/pages/pages.component";
import {PagesComponent} from "../themes/calypso/app/pages/pages.component";
import {i18nBreadcrumbResolver} from "./core/breadcrumbs/i18n-breadcrumb.resolver";

export const APP_ROUTES: Route[] = [
{ path: INTERNAL_SERVER_ERROR, component: ThemedPageInternalServerErrorComponent },
Expand All @@ -60,13 +61,17 @@ export const APP_ROUTES: Route[] = [
path: 'ai-search',
component: AiSearchComponent,
pathMatch: 'full',
resolve: { breadcrumb: i18nBreadcrumbResolver },
data: { title: 'calypso.ai-search', breadcrumbKey: 'calypso.ai-search' },
canActivate: [endUserAgreementCurrentUserGuard]
},
{
path: 'page/:page',
component: PagesComponent,
pathMatch: 'full',
canActivate: [EndUserAgreementCurrentUserGuard]
resolve: { breadcrumb: i18nBreadcrumbResolver },
data: { title: 'calypso.page-udem', breadcrumbKey: 'calypso.page-udem' },
canActivate: [endUserAgreementCurrentUserGuard]
},
//fin add UdeM
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="container">
<ds-themed-feedback-form></ds-themed-feedback-form>
<ds-feedback-form></ds-feedback-form>
</div>
2 changes: 1 addition & 1 deletion src/themes/calypso/app/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="w-100">
<div id="collapsingNav">
<ng-container *ngIf="(isMobile$ | async) && (isAuthenticated$ | async)">
<ds-themed-user-menu [inExpandableNavbar]="true"></ds-themed-user-menu>
<ds-user-menu [inExpandableNavbar]="true"></ds-user-menu>
</ng-container>
<div class="navbar-nav align-items-md-center mr-auto shadow-none gapx-3">
<ng-container *ngFor="let section of (sections | async)">
Expand Down
47 changes: 47 additions & 0 deletions src/themes/calypso/app/pages/faq/faq.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<div class="container">
<h1>{{ 'faq.titre' | translate }}</h1>
<p [innerHTML]="'faq.description' | translate"></p>
<section #faq>

</section>
<div class='faq'>
<input id='faq-a' type='checkbox'>
<label for='faq-a'>
<p class="faq-heading">{{ 'faq.calypso_question' | translate }}</p>
<div class='faq-arrow'></div>
<p class="faq-text" [innerHTML]="'faq.calypso_answer' | translate"></p>
</label>
<input id='faq-b' type='checkbox'>
<label for='faq-b'>
<p class="faq-heading">{{ 'faq.limited_access_question' | translate }}</p>
<div class='faq-arrow'></div>
<p class="faq-text" [innerHTML]="'faq.limited_access_answer' | translate"></p>
</label>
<input id='faq-c' type='checkbox'>
<label for='faq-c'>
<p class="faq-heading">{{ 'faq.simple_search_question' | translate }}</p>
<div class='faq-arrow'></div>
<p class="faq-text" [innerHTML]="'faq.simple_search_answer' | translate"></p>
</label>
<input id='faq-d' type='checkbox'>
<label for='faq-d'>
<p class="faq-heading">{{ 'faq.advanced_search_question' | translate }}</p>
<div class='faq-arrow'></div>
<p class="faq-text" [innerHTML]="'faq.advanced_search_answer' | translate"></p>
</label>
<input id='faq-e' type='checkbox'>
<label for='faq-e'>
<p class="faq-heading">{{ 'faq.tips_tricks_question' | translate }}</p>
<div class='faq-arrow'></div>
<p class="faq-text" [innerHTML]="'faq.tips_tricks_answer' | translate"></p>
</label>
<input id='settings' type='checkbox'>
<input id='faq-f' type='checkbox'>
<label for='faq-f'>
<p class="faq-heading">{{ 'faq.boolean_operators_question' | translate }}</p>
<div class='faq-arrow'></div>
<p class="faq-text" [innerHTML]="'faq.boolean_operators_answer' | translate"></p>
</label>
</div>

</div>
78 changes: 78 additions & 0 deletions src/themes/calypso/app/pages/faq/faq.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

.faq-heading {
font-weight: 400;
font-size: 19px;
-webkit-transition: text-indent 0.2s;
transition: text-indent 0.2s;
text-indent: 20px;
color: #333;
padding-top:10px;
padding-bottom:10px;
}

.faq-text {
font-weight: 400;
color: #919191;
width: 95%;
padding-left: 20px;
margin-bottom: 30px;
}

.faq {
margin: 0 auto;
background: white;
position: relative;

label {
display: block;
position: relative;
overflow: hidden;
cursor: pointer;
height: 56px;
padding-top: 1px;
background-color: #fafafa;
border-bottom: 1px solid #e1e1e1;
}

input[type="checkbox"] {
display: none;
}

.faq-arrow {
width: 5px;
height: 5px;
transition: transform 0.8s, -webkit-transform 0.8s;
-webkit-transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
border-top: 2px solid rgba(0, 0, 0, 0.33);
border-right: 2px solid rgba(0, 0, 0, 0.33);
float: right;
position: relative;
top: -40px;
right: 27px;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}

input[type="checkbox"]:checked + label > .faq-arrow {
-webkit-transform: rotate(135deg);
transform: rotate(135deg);
}

input[type="checkbox"]:checked + label {
background: rgba(255, 255, 255, 1) !important;
color: #4f7351;
height: 225px;
transition: height 0.8s;
-webkit-transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

input[type="checkbox"]:not(:checked) + label {
height: 60px;
transition: height 0.8s;
-webkit-transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
}

::-webkit-scrollbar {
display: none;
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Component} from '@angular/core';
import {ThemedLoadingComponent} from "../../../../app/shared/loading/themed-loading.component";
import {ThemedLoadingComponent} from "../../../../../app/shared/loading/themed-loading.component";
import {TranslateModule} from "@ngx-translate/core";
import {RouterModule} from "@angular/router";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";

@Component({
selector: 'ds-page2',
templateUrl: './page2.component.html',
styleUrls: ['./page2.component.scss'],
selector: 'ds-faq',
templateUrl: './faq.component.html',
styleUrls: ['./faq.component.scss'],
standalone: true,
imports: [ThemedLoadingComponent, TranslateModule, RouterModule, NgbModule],
})
export class Page2Component {
export class FaqComponent {

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component} from '@angular/core';
import {ThemedLoadingComponent} from "../../../../app/shared/loading/themed-loading.component";
import {ThemedLoadingComponent} from "../../../../../app/shared/loading/themed-loading.component";
import {TranslateModule} from "@ngx-translate/core";
import {RouterModule} from "@angular/router";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<div *ngIf="currentComponent">
<ng-container *ngComponentOutlet="currentComponent"></ng-container>
</div>
<p>pages works!</p>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router, RouterModule } from "@angular/router";
import { ThemedLoadingComponent } from "../../../app/shared/loading/themed-loading.component";
import { ThemedLoadingComponent } from "../../../../app/shared/loading/themed-loading.component";
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { TranslateModule } from '@ngx-translate/core';
import { Page1Component } from "./page1/page1.component";
import { Page2Component } from "./page2/page2.component";
import { FaqComponent } from "./faq/faq.component";
import { CommonModule } from '@angular/common';

@Component({
Expand All @@ -18,14 +18,14 @@ import { CommonModule } from '@angular/common';
RouterModule,
NgbModule,
Page1Component,
Page2Component
FaqComponent
],
})
export class PagesComponent implements OnInit {
currentComponent: any;
private readonly componentMap: { [key: string]: any } = {
'page1': Page1Component,
'page2': Page2Component
'faq': FaqComponent
};

constructor(
Expand All @@ -46,8 +46,13 @@ export class PagesComponent implements OnInit {
});
}

// Function to reload URL
/**
* Fonction pour recharger l'URL de manière propre
* @param url - L'URL cible vers laquelle rediriger
* @returns Une promesse de navigation
*/
reload(url: string): Promise<boolean> {
// Navigation temporaire vers l'URL courante sans changer l'historique, puis redirection vers l'URL cible
return this.router.navigateByUrl('.', { skipLocationChange: true })
.then(() => this.router.navigateByUrl(url));
}
Expand Down
Empty file.
45 changes: 45 additions & 0 deletions src/themes/calypso/app/root/root.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import {
AsyncPipe,
NgClass,
NgIf,
} from '@angular/common';
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';

import { ThemedAdminSidebarComponent } from '../../../../app/admin/admin-sidebar/themed-admin-sidebar.component';
import { ThemedBreadcrumbsComponent } from '../../../../app/breadcrumbs/themed-breadcrumbs.component';
import { ThemedFooterComponent } from '../../../../app/footer/themed-footer.component';
import { ThemedHeaderNavbarWrapperComponent } from '../../../../app/header-nav-wrapper/themed-header-navbar-wrapper.component';
import { RootComponent as BaseComponent } from '../../../../app/root/root.component';
import { slideSidebarPadding } from '../../../../app/shared/animations/slide';
import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component';
import { NotificationsBoardComponent } from '../../../../app/shared/notifications/notifications-board/notifications-board.component';
import { SystemWideAlertBannerComponent } from '../../../../app/system-wide-alert/alert-banner/system-wide-alert-banner.component';

@Component({
selector: 'ds-themed-root',
// styleUrls: ['./root.component.scss'],
styleUrls: ['../../../../app/root/root.component.scss'],
// templateUrl: './root.component.html',
templateUrl: '../../../../app/root/root.component.html',
animations: [slideSidebarPadding],
standalone: true,
imports: [
TranslateModule,
ThemedAdminSidebarComponent,
SystemWideAlertBannerComponent,
ThemedHeaderNavbarWrapperComponent,
ThemedBreadcrumbsComponent,
NgIf,
NgClass,
ThemedLoadingComponent,
RouterOutlet,
ThemedFooterComponent,
NotificationsBoardComponent,
AsyncPipe,
],
})
export class RootComponent extends BaseComponent {

}
63 changes: 50 additions & 13 deletions src/themes/calypso/assets/i18n/en.json5
Original file line number Diff line number Diff line change
@@ -1,18 +1,55 @@
{
// "repository.title.prefix": "DSpace Angular :: ",
"repository.title.prefix": "Calypso :: ",
"calypso.onglet-fichier": "Files",
"calypso.onglet-notice": "Full Record",
"calypso.tab-files": "Files",
"calypso.tab-notice": "Full notice",
"calypso.return": "Return",
"calypso.consulter": "View",
"calypso.ai-titre": "Perform a search with AI",
"calypso.ai-explication": "Explanation ...",
"calypso.ai-annuler": "Cancel",
"calypso.ai-lien": "Start",
"calypso.ai-search-title": "",
"calypso.ai-search-description": "",
"calypso.ai-charger": "Load more",
"calypso.ai-img-selection": "Selected Image",
"calypso.ai-title-notification": "AI Search Title",
"calypso.ai-content-notification": "Here is a message for AI search"
"calypso.consult": "Consult",
"calypso.ai-title": "Perform a search with AI",
"calypso.ai-explanation": "Explanation ...",
"calypso.ai-cancel": "Cancel",
"calypso.ai-link": "Start",
"calypso.ai-search-title": "Find Similar Images with AI",
"calypso.ai-search-description": "Explore visually similar items from our collection with just one click",
"calypso.ai-load-more": "Load more",
"calypso.ai-selected-img": "Selected image",
"calypso.ai-notification-title": "AI Search Title",
"calypso.ai-notification-content": "Here is a message for the AI search",

//variable pour texte dans nav top
"calypso.page-udem.breadcrumbs": "Lire plus",
"calypso.ai-search.breadcrumbs": "Recherche IA",

// Contact page
"calypso.contact-title": "Contact Us",
"calypso.contact-description": "For any questions or additional information regarding this platform, please do not hesitate to contact us.",
"calypso.contact-phone": "+123 456 7890",
"calypso.contact-email": "[email protected]",
"calypso.contact-links-title": "Stay in touch",
"calypso.contact-libraries": "Libraries",
"calypso.contact-udem": "University of Montreal",

// FAQ
"faq": {
"title": "FAQ - Your Questions, Our Answers",
"description": "Quickly find essential information to better navigate our site",

"calypso_question": "What is Calypso?",
"calypso_answer": "Calypso is an interface that gathers various digital objects from the collections of the University of Montreal. It allows users to search and access these objects. These objects are primarily images, but also include audio and video files.",

"limited_access_question": "How can I access restricted items?",
"limited_access_answer": "If you are off-campus and wish to access items restricted to the UdeM academic community, you must use the PROXY service to authenticate and gain access.",

"simple_search_question": "What is a simple search?",
"simple_search_answer": "A simple search allows you to find all items containing the word(s) you entered across all areas and collections of Calypso. For example, if you type \"navigation québec\", Calypso will display all items that contain the terms \"navigation\" AND \"québec\".",

"advanced_search_question": "What is an advanced search?",
"advanced_search_answer": "An advanced search allows you to refine your results by searching within one or more collections with specific parameters such as: <strong>Title</strong>, <strong>Subject</strong>, <strong>Document Type</strong>, <strong>Description</strong>, <strong>Date</strong>. You can display up to four search fields for more precise results.",

"tips_tricks_question": "What are some tips and tricks for an effective search?",
"tips_tricks_answer": "Use meaningful words in your searches for more relevant results. To search for an exact phrase, using quotation marks (\"classical music\") does not work. Instead, use the \"Exact Phrase\" option in advanced search. Pay attention to punctuation as it is taken into account in searches. The relevance of results is influenced by the frequency of keywords in the item. Matches found in the <strong>Title</strong> or <strong>Subject</strong> fields are given higher priority. To search for plurals or perform partial word searches, use truncation (*). For example: ville* will find \"ville\" and \"villes\"; pla*e will find \"place\", \"plane\", etc.",

"boolean_operators_question": "What boolean operators are available?",
"boolean_operators_answer": "<strong>AND</strong>: This operator is automatically used in the \"All of these words\" search. This means that Calypso will display results that contain all the words you entered. <strong>OR</strong>: Used in the \"Any of these words\" search, this operator allows you to find results that contain at least one of the entered words. <strong>NOT</strong>: To exclude certain words from your results, use a search box with the \"none of these words\" option. This helps refine your search by removing items that contain these terms."
}
}
Loading

0 comments on commit 52a86f2

Please sign in to comment.