pull/10/head
Kevin MONDEJAR 4 months ago
parent 6cf118f8b2
commit 0176d13e3d

@ -1,4 +1,5 @@
@page "/modifquote" @using WF_WebAdmin.Model
@page "/modifquote"
<PageTitle>Corection des citation</PageTitle> <PageTitle>Corection des citation</PageTitle>
@ -8,38 +9,16 @@
@if (quotes != null) @if (quotes != null)
{ {
<table class="table"> <DataGrid TItem="Quote"
<thead> Data="@quotes"
<tr> PageSize="int.MaxValue"
<th>Image</th> Responsive>
<th>Id</th>
<th>Contenu</th> <DataGridColumn TItem="Quote" Field="@nameof(Quote.Id)" Caption="Id"/>
<th>Personage</th> <DataGridColumn TItem="Quote" Field="@nameof(Quote.Content)" Caption="Citation"/>
<th>Titre Source</th> <DataGridColumn TItem="Quote" Field="@nameof(Quote.Charac)" Caption="Personage"/>
<th>Likes</th> <DataGridColumn TItem="Quote" Field="@nameof(Quote.TitleSrc)" Caption="Source" />
<th>Langue</th> <DataGridColumn TItem="Quote" Field="@nameof(Quote.Langue)" Caption="Langue" />
<th>Date Source</th> <DataGridColumn TItem="Quote" Field="@nameof(Quote.DateSrc)" Caption="Date" DisplayFormat="{0:d}" DisplayFormatProvider="@System.Globalization.CultureInfo.GetCultureInfo("fr-FR")" />
</tr> </DataGrid>
</thead>
<tbody>
@foreach (var quote in quotes)
{
<tr>
<td><img class="imgTab" src="@quote.ImgPath" /></td>
<td>@quote.Id</td>
<td>
<label>
<input @bind="quote.Content" />
</label>
</td>
<td>@quote.Charac</td>
<td>@quote.TitleSrc</td>
<td>@quote.Like</td>
<td>@quote.Langue</td>
<td>@quote.DateSrc.ToShortDateString()</td>
</tr>
}
</tbody>
<button>Sauvegarder</button>
</table>
} }

@ -7,6 +7,8 @@ namespace WF_WebAdmin.Pages
{ {
private Quote[] quotes; private Quote[] quotes;
private int MaxValue = 5;
[Inject] [Inject]
public HttpClient Http { get; set; } public HttpClient Http { get; set; }

@ -28,5 +28,10 @@
</div> </div>
<script src="_framework/blazor.server.js"></script> <script src="_framework/blazor.server.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css">
<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
<link href="_content/Blazorise.Bootstrap/blazorise.bootstrap.css" rel="stylesheet" />
</body> </body>
</html> </html>

@ -1,3 +1,6 @@
using Blazorise;
using Blazorise.Bootstrap;
using Blazorise.Icons.FontAwesome;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web;
using WF_WebAdmin.Data; using WF_WebAdmin.Data;
@ -11,6 +14,11 @@ builder.Services.AddSingleton<WeatherForecastService>();
builder.Services.AddHttpClient(); builder.Services.AddHttpClient();
builder.Services
.AddBlazorise()
.AddBootstrapProviders()
.AddFontAwesomeIcons();
var app = builder.Build(); var app = builder.Build();
// Configure the HTTP request pipeline. // Configure the HTTP request pipeline.

@ -7,4 +7,11 @@
<RootNamespace>WF_WebAdmin</RootNamespace> <RootNamespace>WF_WebAdmin</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap" Version="1.7.2" />
<PackageReference Include="Blazorise.DataGrid" Version="1.7.2" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.7.2" />
<PackageReference Include="bootstrap" Version="5.3.3" />
</ItemGroup>
</Project> </Project>

@ -8,3 +8,4 @@
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using WF_WebAdmin @using WF_WebAdmin
@using WF_WebAdmin.Shared @using WF_WebAdmin.Shared
@using Blazorise.DataGrid

@ -1,4 +1,70 @@
[ [
{
"Id": 1,
"ImgPath": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7",
"Content": "Harry POTTER JE SUIS TON PERE",
"Charac": "Sirius Black",
"TitleSrc": "Harry Potter",
"Langue": "fr",
"UserProposition": "demo",
"DateSrc": "2001-01-01",
"Like": 20
},
{
"Id": 2,
"ImgPath": "https://tse2.mm.bing.net/th/id/OIP.zR4rzkK7q2wCcNwZd6jjegHaIC?w=163&h=180&c=7&r=0&o=5&pid=1.7",
"Content": "'Une autre citation'",
"Charac": "Un personnage",
"TitleSrc": "Un super film",
"Langue": "fr",
"DateSrc": "2002-02-02",
"Like": 0,
"UserProposition": "exploit"
},
{
"Id": 1,
"ImgPath": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7",
"Content": "Harry POTTER JE SUIS TON PERE",
"Charac": "Sirius Black",
"TitleSrc": "Harry Potter",
"Langue": "fr",
"UserProposition": "demo",
"DateSrc": "2001-01-01",
"Like": 20
},
{
"Id": 2,
"ImgPath": "https://tse2.mm.bing.net/th/id/OIP.zR4rzkK7q2wCcNwZd6jjegHaIC?w=163&h=180&c=7&r=0&o=5&pid=1.7",
"Content": "'Une autre citation'",
"Charac": "Un personnage",
"TitleSrc": "Un super film",
"Langue": "fr",
"DateSrc": "2002-02-02",
"Like": 0,
"UserProposition": "exploit"
},
{
"Id": 1,
"ImgPath": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7",
"Content": "Harry POTTER JE SUIS TON PERE",
"Charac": "Sirius Black",
"TitleSrc": "Harry Potter",
"Langue": "fr",
"UserProposition": "demo",
"DateSrc": "2001-01-01",
"Like": 20
},
{
"Id": 2,
"ImgPath": "https://tse2.mm.bing.net/th/id/OIP.zR4rzkK7q2wCcNwZd6jjegHaIC?w=163&h=180&c=7&r=0&o=5&pid=1.7",
"Content": "'Une autre citation'",
"Charac": "Un personnage",
"TitleSrc": "Un super film",
"Langue": "fr",
"DateSrc": "2002-02-02",
"Like": 0,
"UserProposition": "exploit"
},
{ {
"Id": 1, "Id": 1,
"ImgPath": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", "ImgPath": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7",

Loading…
Cancel
Save