style & Rate edition

This commit is contained in:
2017-03-10 11:57:25 +01:00
parent 96d2b466ca
commit ba433e51a1
4 changed files with 49 additions and 25 deletions

View File

@ -14,39 +14,43 @@ namespace Yavsc.Models.Workflow
{ {
[StringLength(512), Required, Key] [StringLength(512), Required, Key]
[Display(Name = "Code")]
public string Code { get; set; } public string Code { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[StringLength(512), Required()] [StringLength(512), Required()]
[Display(Name = "Nom")]
public string Name { get; set; } public string Name { get; set; }
[StringLength(512)] [StringLength(512)]
[Display(Name = "Code du parent")]
public string ParentCode { get; set; } public string ParentCode { get; set; }
[ForeignKey("ParentCode"), JsonIgnore] [ForeignKey("ParentCode"), JsonIgnore]
[Display(Name = "Activité parent")]
public virtual Activity Parent { get; set; } public virtual Activity Parent { get; set; }
[InverseProperty("Parent"), JsonIgnore] [InverseProperty("Parent"), JsonIgnore]
[Display(Name = "Activités filles")]
public virtual List<Activity> Children { get; set; } public virtual List<Activity> Children { get; set; }
[Display(Name = "Description")]
public string Description { get; set; } public string Description { get; set; }
/// <summary>
/// Name to associate to a performer in this activity domain
/// </summary>
[Obsolete]
public string ActorDenomination { get; set; }
[Display(Name = "Photo")]
public string Photo { get; set; } public string Photo { get; set; }
[InverseProperty("Context")] [InverseProperty("Context")]
[DisplayAttribute(Name = "Services liés")]
public List<Service> Services { get; set; } public List<Service> Services { get; set; }
/// <summary> /// <summary>
/// Moderation settings /// Moderation settings
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[DisplayAttribute(Name = "Groupe de modération")]
public string ModeratorGroupName { get; set; } public string ModeratorGroupName { get; set; }
/// <summary> /// <summary>
@ -55,34 +59,42 @@ namespace Yavsc.Models.Workflow
/// Valide entre 0 et 100, /// Valide entre 0 et 100,
/// Il démarre à 0. /// Il démarre à 0.
/// </summary> /// </summary>
[Range(0, 100)] [Range(0, 100)][DisplayAttribute(Name = "Indice d'exposition")]
[DisplayFormatAttribute(DataFormatString="{0}%")]
public int Rate { get; set; } public int Rate { get; set; }
[DisplayAttribute(Name = "SettingsClass")] [DisplayAttribute(Name = "Classe de paramétrage")]
public string SettingsClassName { get; set; } public string SettingsClassName { get; set; }
[InverseProperty("Context")] [InverseProperty("Context")]
[Display(Name="Formulaires de commande")]
public virtual List<CommandForm> Forms { get; set; } public virtual List<CommandForm> Forms { get; set; }
[Display(Name="Date de création")]
public DateTime DateCreated public DateTime DateCreated
{ {
get; set; get; set;
} }
[Display(Name="Createur")]
public string UserCreated public string UserCreated
{ {
get; set; get; set;
} }
[Display(Name="Date de dernière modification")]
public DateTime DateModified public DateTime DateModified
{ {
get; set; get; set;
} }
[Display(Name="Utilisateur ayant modifié le dernier")]
public string UserModified public string UserModified
{ {
get; set; get; set;
} }
[Display(Name="Caché")]
public bool Hidden { get; set; } public bool Hidden { get; set; }
} }

View File

@ -33,8 +33,8 @@
<form asp-action="Delete"> <form asp-action="Delete">
<div class="form-actions no-color"> <div class="form-actions no-color">
<input type="submit" value="Delete" class="btn btn-default" /> | <input type="submit" value="Delete" class="btn btn-danger" />
<a asp-action="Index">Back to List</a> <a asp-action="Index" class="btn btn-link">Back to List</a>
</div> </div>
</form> </form>
</div> </div>

View File

@ -48,9 +48,7 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="SettingsClassName" class="col-md-2 control-label"> <label asp-for="SettingsClassName" class="col-md-2 control-label"></label>
@SR["SettingsClass"]
</label>
<div class="col-md-10"> <div class="col-md-10">
<select asp-for="SettingsClassName" class="form-control" asp-items="@ViewBag.SettingsClassName"> <select asp-for="SettingsClassName" class="form-control" asp-items="@ViewBag.SettingsClassName">
</select> </select>
@ -58,14 +56,19 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="Hidden" class="col-md-2 control-label"> <label asp-for="Hidden" class="col-md-2 control-label"></label>
@SR["Hidden"]
</label>
<div class="col-md-10"> <div class="col-md-10">
<input asp-for="Hidden" class="form-control" /> <input asp-for="Hidden" class="form-control" />
<span asp-validation-for="Hidden" class="text-danger" /> <span asp-validation-for="Hidden" class="text-danger" />
</div> </div>
</div> </div>
<div class="form-group">
<label asp-for="Rate" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Rate" class="form-control" />
<span asp-validation-for="Rate" class="text-danger" />
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-md-offset-2 col-md-10"> <div class="col-md-offset-2 col-md-10">
<input type="submit" value="Save" class="btn btn-default" /> <input type="submit" value="Save" class="btn btn-default" />

View File

@ -12,10 +12,10 @@
<table class="table"> <table class="table">
<tr> <tr>
<th> <th>
@Html.DisplayNameFor(model => model.Code) @Html.DisplayNameFor(model => model.Name)
</th> </th>
<th> <th>
@SR["Name"] @Html.DisplayNameFor(model => model.Code)
</th> </th>
<th> <th>
@ -25,20 +25,26 @@
@Html.DisplayNameFor(model => model.Photo) @Html.DisplayNameFor(model => model.Photo)
</th> </th>
<th> <th>
@Html.DisplayNameFor(model => model.Parent) @Html.DisplayNameFor(model => model.Parent)
</th> </th>
<th> <th>
@SR["SettingsClass"] @Html.DisplayNameFor(model => model.SettingsClassName)
</th>
<th>
@Html.DisplayNameFor(model => model.Children)
</th>
<th>
@Html.DisplayNameFor(model => model.Rate)
</th> </th>
</tr> </tr>
@foreach (var item in Model) { @foreach (var item in Model) {
<tr> <tr>
<td> <td>
@Html.DisplayFor(modelItem => item.Code) <a name="@item.Code" class="btn btn-link"></a> @Html.DisplayFor(modelItem => item.Name)
</td> </td>
<td> <td>
@Html.DisplayFor(modelItem => item.Name) @Html.DisplayFor(modelItem => item.Code)
</td> </td>
<td> <td>
@Html.DisplayFor(modelItem => item.Description) @Html.DisplayFor(modelItem => item.Description)
@ -50,7 +56,7 @@
<td> <td>
@if (item.Parent!=null) { @if (item.Parent!=null) {
<text> <text>
@Html.DisplayFor(modelItem => item.Parent) <a href="#@item.ParentCode">@Html.DisplayFor(modelItem => item.Parent)</a>
</text> </text>
} }
</td> </td>
@ -65,9 +71,12 @@
@Html.DisplayFor(modelItem => item.Children) @Html.DisplayFor(modelItem => item.Children)
</td> </td>
<td> <td>
<a asp-action="Edit" asp-route-id="@item.Code">Edit</a> | @Html.DisplayFor(modelItem => item.Rate)
<a asp-action="Details" asp-route-id="@item.Code">Details</a> | </td>
<a asp-action="Delete" asp-route-id="@item.Code">Delete</a> <td>
<a asp-action="Edit" asp-route-id="@item.Code" class="btn btn-default">Edit</a>
<a asp-action="Details" asp-route-id="@item.Code" class="btn btn-success">Details</a>
<a asp-action="Delete" asp-route-id="@item.Code" class="btn btn-danger">Delete</a>
</td> </td>
</tr> </tr>
} }