Merge remote-tracking branch 'origin/dev' into patch_dev
This commit is contained in:
@@ -107,5 +107,19 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Un tuple contenant l'identifiant et le libellé du titre le plus joué, ou null si aucun titre n'existe.</returns>
|
/// <returns>Un tuple contenant l'identifiant et le libellé du titre le plus joué, ou null si aucun titre n'existe.</returns>
|
||||||
(int IdTitre, string Libelle)? FindMostPlayedTitle();
|
(int IdTitre, string Libelle)? FindMostPlayedTitle();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Récupération des chroniques.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="offset">Nombre d'éléments.</param>
|
||||||
|
/// <param name="limit">Limite d'éléments.</param>
|
||||||
|
/// <returns>Liste des derniers titres chroniqués.</returns>
|
||||||
|
IEnumerable<Titre> DerniereChronique(int offset, int limit);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Récupération du top titre liké.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Liste de titre les plus likés.</returns>
|
||||||
|
IEnumerable<Titre> TopTitre(int offset, int limit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -409,4 +409,45 @@ public class DbTitreRepository : ITitreRepository
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IEnumerable<Titre> DerniereChronique(int offset, int limit)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
this.logger.LogInformation("Récupération des dernières chroniques.");
|
||||||
|
|
||||||
|
return this.context.Titres
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderByDescending(t => t.DateCreation)
|
||||||
|
.Paginate(offset, limit)
|
||||||
|
.Include(t => t.Artiste);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.logger.LogError(ex, "Erreur lors de la recuperation des dernieres chroniques.");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IEnumerable<Titre> TopTitre(int offset, int limit)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
this.logger.LogInformation("Récupération du Top Titre.");
|
||||||
|
var titres = this.context.Titres
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderByDescending(t => t.NbLikes)
|
||||||
|
.Paginate(offset, limit)
|
||||||
|
.Include(a => a.Artiste);
|
||||||
|
|
||||||
|
return titres;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.logger.LogError(ex, "Erreur lors de la récupération du Top Titre.");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -181,4 +181,39 @@ public class LocalTitreRepository : ITitreRepository
|
|||||||
|
|
||||||
return titre == null ? null : (titre.IdTitre, titre.Libelle);
|
return titre == null ? null : (titre.IdTitre, titre.Libelle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IEnumerable<Titre> DerniereChronique(int offset, int limit)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return this.dataStore.Titres
|
||||||
|
.OrderByDescending(t => t.DateCreation)
|
||||||
|
.Paginate(offset, limit);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.logger.LogError(ex, "Erreur lors de la recuperation des dernieres chroniques.");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IEnumerable<Titre> TopTitre(int offset, int limit)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
this.logger.LogInformation("Récupération du Top Titre.");
|
||||||
|
var titres = this.dataStore.Titres
|
||||||
|
.OrderByDescending(t => t.NbLikes)
|
||||||
|
.Paginate(offset, limit);
|
||||||
|
|
||||||
|
return titres;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.logger.LogError(ex, "Erreur lors de la récupération du Top Titre.");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,6 @@
|
|||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
this.titreRepository = titreRepository;
|
this.titreRepository = titreRepository;
|
||||||
this.logger.LogDebug(1, "initialisation du AccueilController");
|
this.logger.LogDebug(1, "initialisation du AccueilController");
|
||||||
this.titreRepository = titreRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -45,17 +44,18 @@
|
|||||||
|
|
||||||
var derniereChronique = this.configuration.GetValue<int>("Webzine:NombreDerniereChronique");
|
var derniereChronique = this.configuration.GetValue<int>("Webzine:NombreDerniereChronique");
|
||||||
var nbTopTitres = this.configuration.GetValue<int>("Webzine:NombreDeTopTitres");
|
var nbTopTitres = this.configuration.GetValue<int>("Webzine:NombreDeTopTitres");
|
||||||
|
var totalTitres = this.titreRepository.Count();
|
||||||
|
var totalPages = (int)Math.Ceiling((double)totalTitres / derniereChronique);
|
||||||
|
|
||||||
var titres_pagines = this.titreRepository.FindTitres(page * derniereChronique, derniereChronique);
|
var titresPagines = this.titreRepository.DerniereChronique(page * derniereChronique, derniereChronique).ToList();
|
||||||
var top_titres = this.titreRepository.FindAll()
|
var topTitres = this.titreRepository.TopTitre(nbTopTitres, nbTopTitres).ToList();
|
||||||
.OrderByDescending(t => t.NbLikes)
|
|
||||||
.Take(nbTopTitres);
|
|
||||||
|
|
||||||
var vm = new AccueilIndexViewModel
|
var vm = new AccueilIndexViewModel
|
||||||
{
|
{
|
||||||
DerniersTitres = titres_pagines.ToList(),
|
DerniersTitres = titresPagines,
|
||||||
TopTitres = top_titres.ToList(),
|
TopTitres = topTitres,
|
||||||
Page = page,
|
Page = page,
|
||||||
|
TotalPages = totalPages,
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.View(vm);
|
return this.View(vm);
|
||||||
|
|||||||
@@ -26,5 +26,10 @@
|
|||||||
/// Obtient ou définit le numéro de page pour la pagination des titres affichés sur la page d'accueil.
|
/// Obtient ou définit le numéro de page pour la pagination des titres affichés sur la page d'accueil.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Page { get; set; } = 0;
|
public int Page { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Nombre total de page.
|
||||||
|
/// </summary>
|
||||||
|
public int TotalPages { get; set; } = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -73,12 +73,21 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<!-- Bouton -->
|
<!-- Bouton -->
|
||||||
<div class="row justify-content-end">
|
<div class="row justify-content-between">
|
||||||
<a asp-action="Index" asp-route-page="@(Model.Page + 1)"
|
@if (Model.Page > 0)
|
||||||
class="btn btn-secondary col-auto mt-3">
|
{
|
||||||
Titres plus anciens >>
|
<a asp-action="Index" asp-route-page="@(Model.Page - 1)"
|
||||||
</button>
|
class="btn btn-secondary col-auto mt-3">
|
||||||
</a>
|
<< Titre plus récent
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
@if (Model.Page < Model.TotalPages - 1)
|
||||||
|
{
|
||||||
|
<a asp-action="Index" asp-route-page="@(Model.Page + 1)"
|
||||||
|
class="btn btn-secondary col-auto mt-3 ms-auto">
|
||||||
|
Titre plus anciens >>
|
||||||
|
</a>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class ="my-2">
|
<div class ="my-2">
|
||||||
<i class="fa-solid fa-phone"></i> Phone : 03 80 40 50 60<br />
|
<a href="tel:+0380405060"><i class="fa-solid fa-phone"></i> Phone : 03 80 40 50 60</a><br />
|
||||||
<i class="fa-solid fa-envelope"></i> <span class="text-primary">secretariat@cucdb.fr</span>
|
<a href="mailto:secretariat@cucdb.fr"><i class="fa-solid fa-envelope"></i> <span class="text-primary">secretariat@cucdb.fr</span></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -22,35 +22,35 @@
|
|||||||
<h2>Suivez-nous</h2>
|
<h2>Suivez-nous</h2>
|
||||||
<div class="row g-4 text-center">
|
<div class="row g-4 text-center">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
<a href="https://diiage.cucdb.fr/" class="card h-100 p-4 border-0 bg-light">
|
||||||
<i class="fa-solid fa-link fa-3x text-primary mb-3 align-self-center"></i>
|
<i class="fa-solid fa-link fa-3x text-primary mb-3 align-self-center"></i>
|
||||||
<div class="fw-bold text-primary">Site officiel du DIIAGE</div>
|
<div class="fw-bold text-primary">Site officiel du DIIAGE</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
<a href="https://www.facebook.com/diiage" class="card h-100 p-4 border-0 bg-light">
|
||||||
<i class="fa-brands fa-facebook fa-3x text-primary mb-3 align-self-center"></i>
|
<i class="fa-brands fa-facebook fa-3x text-primary mb-3 align-self-center"></i>
|
||||||
<div class="fw-bold text-primary">Facebook</div>
|
<div class="fw-bold text-primary">Facebook</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
<a href="https://www.instagram.com/diiage.cucdb/" class="card h-100 p-4 border-0 bg-light">
|
||||||
<i class="fa-brands fa-instagram fa-3x text-primary mb-3 align-self-center"></i>
|
<i class="fa-brands fa-instagram fa-3x text-primary mb-3 align-self-center"></i>
|
||||||
<div class="fw-bold text-primary">Instagram</div>
|
<div class="fw-bold text-primary">Instagram</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
<a href="https://www.linkedin.com/company/diiage/posts/?feedView=all" class="card h-100 p-4 border-0 bg-light">
|
||||||
<i class="fa-brands fa-linkedin fa-3x text-primary mb-3 align-self-center"></i>
|
<i class="fa-brands fa-linkedin fa-3x text-primary mb-3 align-self-center"></i>
|
||||||
<div class="fw-bold text-primary">LinkedIn</div>
|
<div class="fw-bold text-primary">LinkedIn</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
<a href="https://www.google.com/maps/place/C.U.C.D.B.+Centre+Universitaire+Catholique+De+Bourgogne/%4047.3348851,5.0514267,695m/data=!3m1!1e3!4m6!3m5!1s0x47f29dfee14743ed:0x7d1348ede68455cb!8m2!3d47.3348851!4d5.0540016!16s%2Fg%2F1td04cy3?entry=ttu&g_ep=EgoyMDI2MDQwMS4wIKXMDSoASAFQAw%3D%3D" class="card h-100 p-4 border-0 bg-light">
|
||||||
<i class="fa-solid fa-map fa-3x text-primary mb-3 align-self-center"></i>
|
<i class="fa-solid fa-map fa-3x text-primary mb-3 align-self-center"></i>
|
||||||
<div class="fw-bold text-primary">Google Maps</div>
|
<div class="fw-bold text-primary">Google Maps</div>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user