style : page accueil + pages ajouter

Multiplayer_Php
Yvan CALATAYUD 1 year ago
parent c8abacb857
commit 6bbeed7cfa

@ -1,24 +1,35 @@
@page "/addAdministrator"
@using Blazor.Models
@using Blazor.Components
<h3>@Localizer["Title"]</h3>
<EditForm Model="@administratorModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<BackButton RedirectionPage="/administrators"></BackButton>
<p>
<label for="username">
@Localizer["Username"] :
<InputText id="username" @bind-Value="administratorModel.Username" />
</label>
</p>
<p>
<label for="hashedPassword">
@Localizer["Password"] :
<InputText id="hashedPassword" @bind-Value="administratorModel.HashedPassword" />
</label>
</p>
<div class="container text-center">
<div class="border border-dark p-4 d-inline-block">
<h3>@Localizer["Title"]</h3>
<EditForm Model="@administratorModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<div class="row mb-3">
<div class="col-5 text-end">
<label for="username" class="col-form-label">@Localizer["Username"] :</label>
</div>
<div class="col-7">
<InputText id="username" @bind-Value="administratorModel.Username" class="form-control" />
</div>
</div>
<div class="row mb-3">
<div class="col-5 text-end">
<label for="hashedPassword" class="col-form-label">@Localizer["Password"] :</label>
</div>
<div class="col-7">
<InputText id="hashedPassword" @bind-Value="administratorModel.HashedPassword" class="form-control" />
</div>
</div>
<button type="submit">@Localizer["Submit"]</button>
</EditForm>
<button type="submit" class="btn btn-success mb-2">@Localizer["Submit"]</button>
</EditForm>
</div>
</div>

@ -1,20 +1,29 @@
@page "/addChapter"
@using Blazor.Models
@using Blazor.Components
<h3>@Localizer["Title"]</h3>
<BackButton RedirectionPage="/chapters"></BackButton>
<div class="container text-center">
<div class="border border-dark p-4 d-inline-block">
<h3>@Localizer["Title"]</h3>
<EditForm Model="@chapterModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<p>
<label for="name">
@Localizer["Name"] :
<InputText id="name" @bind-Value="chapterModel.Name" />
</label>
</p>
<EditForm Model="@chapterModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<div class="row mb-3">
<div class="col-4 text-end">
<label for="name" class="col-form-label">@Localizer["Name"] :</label>
</div>
<div class="col-8">
<InputText id="name" @bind-Value="chapterModel.Name" class="form-control" />
</div>
</div>
<button type="submit">@Localizer["Submit"]</button>
</EditForm>
<button type="submit" class="btn btn-success mb-2">@Localizer["Submit"]</button>
</EditForm>
</div>
</div>

@ -0,0 +1,11 @@
@page "/"
<PageTitle>Home</PageTitle>
<div class="container row justify-content-center mb-5">
<img src="/images/mathseduc.png" alt="Logo MathsEduc" class=" col-4" />
</div>
<h1 class="text-center">@Localizer["Title"]</h1>
<p class="text-center">@Localizer["Text"]</p>

@ -0,0 +1,12 @@
using Blazor.Pages.Questions;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
namespace Blazor.Pages
{
public partial class Index
{
[Inject]
public IStringLocalizer<Index> Localizer { get; set; }
}
}

@ -1,23 +1,36 @@
@page "/addPlayer"
@using Blazor.Models
@using Blazor.Components
<h3>@Localizer["Title"]</h3>
<BackButton RedirectionPage="/players"></BackButton>
<EditForm Model="@playerModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<div class="container text-center">
<div class="border border-dark p-4 d-inline-block">
<h3>@Localizer["Title"]</h3>
<p>
<label for="nickname">
@Localizer["Nickname"] :
<InputText id="nickname" @bind-Value="playerModel.Nickname" />
</label>
<label for="hashedPassword">
@Localizer["HashedPassword"] :
<InputText id="hashedPassword" @bind-Value="playerModel.HashedPassword" />
</label>
</p>
<EditForm Model="@playerModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<div class="row mb-3">
<div class="col-5 text-end">
<label for="nickname" class="col-form-label">@Localizer["Nickname"] :</label>
</div>
<div class="col-7">
<InputText id="nickname" @bind-Value="playerModel.Nickname" class="form-control"/>
</div>
</div>
<div class="row mb-3">
<div class="col-5 text-end">
<label for="hashedPassword" class="col-form-label">@Localizer["HashedPassword"] :</label>
</div>
<div class="col-7">
<InputText id="hashedPassword" @bind-Value="playerModel.HashedPassword" class="form-control"/>
</div>
</div>
<button type="submit">@Localizer["Submit"]</button>
</EditForm>
<button type="submit" class="btn btn-success">@Localizer["Submit"]</button>
</EditForm>
</div>
</div>

@ -1,46 +1,72 @@
@page "/addQuestion"
@using Blazor.Models
@using Blazor.Components
<h3>@Localizer["Title"]</h3>
<EditForm Model="@questionModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<p>
<label for="content">
@Localizer["Content"] :
<InputText id="content" @bind-Value="questionModel.Content" />
</label>
</p>
<p>
<label for="idChapter">
@Localizer["Chapter"] :
<InputSelect id="idChapter" @bind-Value="questionModel.IdChapter">
@if (chapters != null)
{
foreach (var chapter in chapters)
{
<option value="@chapter.Id">@chapter.Name</option>
}
}
</InputSelect>
</label>
</p>
@foreach (var index in Enumerable.Range(0, answerModels.Count))
{
var answerModel = answerModels[index];
var checkbox = checkboxs[index];
<p>
<label for="@($"answer{answerModel.Id}")">
@Localizer["Answers"]@(answerModel.Id + 1) :
<InputText id="@($"answer{answerModel.Id}")" @bind-Value="answerModel.Content" />
</label>
<label for="@($"checkbox{checkbox.Id}")">
<InputCheckbox id="@($"checkbox{checkbox.Id}")" @bind-Value="checkbox.IsCorrect" /> Correcte
</label>
</p>
}
<button type="submit">@Localizer["Submit"]</button>
</EditForm>
<BackButton RedirectionPage="/questions"></BackButton>
<div class="container text-center">
<div class="border border-dark p-4 d-inline-block">
<h3>@Localizer["Title"]</h3>
<EditForm Model="@questionModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<div class="row mb-3">
<div class="col-4 text-end">
<label for="content" class="col-form-label">@Localizer["Content"] :</label>
</div>
<div class="col-8">
<InputText id="content" @bind-Value="questionModel.Content" class="form-control" />
</div>
</div>
<div class="row mb-3">
<div class="col-4 text-end">
<label for="idChapter" class="col-form-label">
@Localizer["Chapter"] :
</label>
</div>
<div class="col-8">
<InputSelect id="idChapter" @bind-Value="questionModel.IdChapter" class="form-select">
@if (chapters != null)
{
foreach (var chapter in chapters)
{
<option value="@chapter.Id">@chapter.Name</option>
}
}
</InputSelect>
</div>
</div>
@foreach (var index in Enumerable.Range(0, answerModels.Count))
{
var answerModel = answerModels[index];
var checkbox = checkboxs[index];
<div class="row mb-3">
<div class="col-4 text-end">
<label for="@($"answer{answerModel.Id}")" class="col-form-label">
@Localizer["Answers"]@(answerModel.Id + 1) :
</label>
</div>
<div class="col-5">
<InputText id="@($"answer{answerModel.Id}")" @bind-Value="answerModel.Content" class="form-control" />
</div>
<div class="col-3">
<label for="@($"checkbox{checkbox.Id}")" class="form-check-label">
<InputCheckbox id="@($"checkbox{checkbox.Id}")" @bind-Value="checkbox.IsCorrect" class="form-check-input" /> Correcte
</label>
</div>
</div>
}
<div class="row">
<div class="col-12 text-center">
<button type="submit" class="btn btn-success">@Localizer["Submit"]</button>
</div>
</div>
</EditForm>
</div>
</div>

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Text" xml:space="preserve">
<value>C'est la partie administrateur de l'application MathsEduc. Vous pouvez modifier/ajouter/supprimer des questions ou gérer les joueurs, les administrateurs et les chapitres.</value>
</data>
<data name="Title" xml:space="preserve">
<value>Bienvenue sur le backoffice de MathsEduc</value>
</data>
</root>

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Text" xml:space="preserve">
<value>This is the administrator part of the MathsEduc application. You can edit/add/delete questions or manage players, admins and chapters.</value>
</data>
<data name="Title" xml:space="preserve">
<value>Welcome to the MathsEduc backoffice</value>
</data>
</root>

@ -1,10 +1,10 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">Blazor</a>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<a class="navbar-brand" href="">
<img src="/images/mathseduc_white.png" alt="Logo MathsEduc" height="35px"/>
</a>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu">

@ -1,9 +0,0 @@
@page "/"
<PageTitle>Index</PageTitle>
<h1>Hello, world!</h1>
Welcome to your new app.
<SurveyPrompt Title="How is Blazor working for you?" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Loading…
Cancel
Save