files tree made better.
This commit is contained in:
207
src/Yavsc/Views/Command/BookHaircutStar.cshtml
Normal file
207
src/Yavsc/Views/Command/BookHaircutStar.cshtml
Normal file
@ -0,0 +1,207 @@
|
||||
@model HairPrestationQuery
|
||||
@{ ViewData["Title"] = "Proposition de rendez-vous "+
|
||||
@SR["to"]+" "+ Model.PerformerProfile.Performer.UserName
|
||||
+" ["+SR[ViewBag.Activity.Code]+"]"; }
|
||||
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=@ViewBag.GoogleSettings.BrowserApiKey"></script>
|
||||
<script type="text/javascript" src="~/lib/moment/moment-with-locales.min.js"></script>
|
||||
<script type="text/javascript" src="~/lib/eonasdan-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<link rel="stylesheet" href="~/lib/eonasdan-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
|
||||
@section header {
|
||||
<style>
|
||||
#map {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
}
|
||||
#Location_combo li {
|
||||
cursor: pointer;
|
||||
}
|
||||
#Location_combo li:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@section scripts{
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
var config = {
|
||||
mapId: 'map',
|
||||
addrId: 'Location_Address',
|
||||
longId: 'Location_Longitude',
|
||||
latId: 'Location_Latitude',
|
||||
addrValidationId: 'valloc',
|
||||
formValidId: 'valsum',
|
||||
locComboId: 'loccomb'
|
||||
};
|
||||
|
||||
$.validator.setDefaults({
|
||||
messages: {
|
||||
remote: "Ce lieu n'est pas identifié par les services de géo-localisation Google",
|
||||
required: "Veuillez renseigner ce champ"
|
||||
}
|
||||
});
|
||||
var gmap = new google.maps.Map(document.getElementById(config.mapId), {
|
||||
zoom: 16,
|
||||
center: { lat: 48.862854, lng: 2.2056466 }
|
||||
});
|
||||
var marker;
|
||||
function chooseLoc(sender, loc) {
|
||||
if (sender === 'user') $('#' + config.addrId).val(loc.formatted_address);
|
||||
var pos = loc.geometry.location;
|
||||
var lat = new Number(pos.lat);
|
||||
var lng = new Number(pos.lng);
|
||||
$('#' + config.latId).val(lat.toLocaleString('en'));
|
||||
$('#' + config.longId).val(lng.toLocaleString('en'));
|
||||
gmap.setCenter(pos);
|
||||
if (marker) {
|
||||
marker.setMap(null);
|
||||
}
|
||||
marker = new google.maps.Marker({
|
||||
map: gmap,
|
||||
draggable: true,
|
||||
animation: google.maps.Animation.DROP,
|
||||
position: pos
|
||||
});
|
||||
google.maps.event.addListener(marker, 'dragend', function () {
|
||||
// TODO reverse geo code
|
||||
var pos = marker.getPosition();
|
||||
$('#' + config.latId).val(pos.lat);
|
||||
$('#' + config.longId).val(pos.lng);
|
||||
});
|
||||
$('#' + config.addrId).valid();
|
||||
$('#' + config.addrValidationId).empty();
|
||||
$('#' + config.formValidId).empty();
|
||||
return true;
|
||||
}
|
||||
|
||||
$('#EventDate').datepicker({ language: 'fr' });
|
||||
|
||||
$('#' + config.addrId).rules("add",
|
||||
{
|
||||
remote: {
|
||||
url: 'https://maps.googleapis.com/maps/api/geocode/json',
|
||||
type: 'get',
|
||||
data: {
|
||||
sensor: false,
|
||||
address: function () { return $('#' + config.addrId).val() }
|
||||
},
|
||||
dataType: 'json',
|
||||
dataFilter: function (datastr, type) {
|
||||
$('#' + config.locComboId).html("");
|
||||
var data = JSON.parse(datastr);
|
||||
data.results.forEach(function (element) {
|
||||
if (element.formatted_address !== $('#' + config.addrId).val()) {
|
||||
$('<li>' + element.formatted_address + '</li>')
|
||||
.data("geoloc", element)
|
||||
.click(function () { chooseLoc('user', $(this).data("geoloc")) })
|
||||
.appendTo($('#' + config.locComboId));
|
||||
}
|
||||
else { }
|
||||
});
|
||||
if ((data.status === 'OK') && (data.results.length == 1)) {
|
||||
chooseLoc('google', data.results[0]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
console.log('ajax loading error ... ' + textStatus + ' ... ' + errorThrown);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
<form asp-action="Create" id="FrmComCre" role="form">
|
||||
<div class="form-horizontal">
|
||||
<h4>@SR["Fill in your book query"]</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.All" class="text-danger" id="valsum"></div>
|
||||
<div class="form-group" has-feedback>
|
||||
<fieldset>
|
||||
<legend>Votre évennement</legend>
|
||||
<label for="EventDate" class="col-md-2 control-label">
|
||||
@SR["Event date"]
|
||||
</label>
|
||||
<div class="col-md-10">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class='col-sm-6'>
|
||||
<div class='input-group date' id='datetimepicker2'>
|
||||
<input class="form-control" name="EventDate" />
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#datetimepicker2').datetimepicker({
|
||||
locale: 'fr',
|
||||
format: "YYYY/MM/DD hh:mm"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<span asp-validation-for="EventDate" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label for="Location_Address" class="col-md-2 control-label">
|
||||
@SR["Location"]
|
||||
</label>
|
||||
<div class="col-md-10">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class='col-sm-6'>
|
||||
<div >
|
||||
<input asp-for="Location.Address" type="text" name="Location.Address" id="Location_Address" class="form-control" data-val-required=@SR[
|
||||
"SpecifyPlace"] data-val-remote=@SR[ "GoogleDidntGeoLocalized"]>
|
||||
<span asp-validation-for="Location.Address" class="text-danger" id="valloc"></span>
|
||||
<ul id="loccomb">
|
||||
</ul>
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<label for="Reason" class="col-md-2 control-label">
|
||||
Ci-après, Vous pouvez ajouter des détails au sujet de vos souhaits
|
||||
concernant cette prestation
|
||||
</label>
|
||||
<div class="col-md-10">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class='col-sm-6'>
|
||||
<div id='reason1'>
|
||||
<textarea rows="15" asp-for="Reason" type="text" name="Reason" id="Reason" maxlength="4096" class="form-control"></textarea>
|
||||
<span asp-validation-for="Reason" class="text-danger"></span>
|
||||
@Html.HiddenFor(model=>model.Location.Latitude)
|
||||
@Html.HiddenFor(model=>model.Location.Longitude)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="@SR[" Create "]" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
@Html.HiddenFor(model=>model.ClientId)
|
||||
@Html.HiddenFor(model=>model.PerformerId)
|
||||
@Html.HiddenFor(model=>model.ActivityCode)
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
|
47
src/Yavsc/Views/Command/CommandConfirmation.cshtml
Normal file
47
src/Yavsc/Views/Command/CommandConfirmation.cshtml
Normal file
@ -0,0 +1,47 @@
|
||||
@model RdvQuery
|
||||
@using Yavsc.Models.Google.Messaging
|
||||
@{
|
||||
ViewData["Title"] = SR["Command confirmation"]+" "+ViewBag.Activity.Name;
|
||||
}
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
<div class="form-horizontal">
|
||||
<h4>@SR["Your book query"]</h4>
|
||||
<hr />
|
||||
<label for="EventDate">@SR["Event date"]</label>: @Html.DisplayFor(m => m.EventDate)
|
||||
<br/>
|
||||
|
||||
<label for="Location">@SR["Location"]</label>: @Html.DisplayFor(m => m.Location)
|
||||
<br/>
|
||||
|
||||
@if (ViewBag.GooglePayload !=null)
|
||||
{
|
||||
@if (ViewBag.GooglePayload.success>0) {
|
||||
<h4>@SR["GCM Notifications sent"]</h4>
|
||||
}
|
||||
else {
|
||||
if (ViewBag.GooglePayload.failure>0)
|
||||
{
|
||||
<h4>@SR["GCM Notification sending failed"]</h4>
|
||||
<pre><code>@Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.GooglePayload)</code></pre>
|
||||
}
|
||||
}
|
||||
}
|
||||
@if (ViewBag.EmailSent!=null)
|
||||
{
|
||||
if (ViewBag.EmailSent.Sent) {
|
||||
<h4>@String.Format(SR["EmailSentToPerformer"],User.GetUserName())</h4>
|
||||
} else {
|
||||
var sent = ViewBag.EmailSent;
|
||||
|
||||
<h4>Une erreur est survenue à lenvoi de l'e-mail au préstataire ...</h4>
|
||||
<environment names="Development">
|
||||
<text>Mail:</text> @sent.EMail;
|
||||
<text>MsgId:</text> @sent.MessageId;
|
||||
<text>Sent:</text> @sent.Sent;
|
||||
<text>Error:</text> @sent.ErrorMessage;
|
||||
</environment>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
|
113
src/Yavsc/Views/Command/Create.cshtml
Normal file
113
src/Yavsc/Views/Command/Create.cshtml
Normal file
@ -0,0 +1,113 @@
|
||||
@model RdvQuery
|
||||
@{ ViewData["Title"] = $"Proposition de rendez-vous à {Model.PerformerProfile.Performer.UserName} [{ViewBag.Activity.Name}]"; }
|
||||
@section scripts {
|
||||
<script type="text/javascript" src="~/lib/moment/moment-with-locales.min.js"></script>
|
||||
<script type="text/javascript" src="~/lib/eonasdan-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<link rel="stylesheet" href="~/lib/eonasdan-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
|
||||
<link rel="stylesheet" href="~/lib/eonasdan-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
|
||||
<style>
|
||||
#map {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#datetimepicker2').datetimepicker({
|
||||
locale: 'fr',
|
||||
format: "YYYY/MM/DD HH:mm"
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
}
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
<form asp-action="Create" method="post">
|
||||
<div class="form-horizontal">
|
||||
<h4>Saisissez votre demande de rendez-vous</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.All" class="text-danger"></div>
|
||||
<div class="form-group" has-feedback>
|
||||
<fieldset>
|
||||
<legend>Votre évennement</legend>
|
||||
<label for="EventDate" class="col-md-2 control-label">
|
||||
Date de l'évennement
|
||||
</label>
|
||||
<div class="col-md-10">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class='col-sm-6'>
|
||||
<div class='input-group date' id='datetimepicker2'>
|
||||
<input class="form-control" name="EventDate" />
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span asp-validation-for="EventDate" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label for="Location_Address" class="col-md-2 control-label">
|
||||
Lieu
|
||||
</label>
|
||||
<div class="col-md-10">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class='col-sm-6'>
|
||||
<div >
|
||||
<input asp-for="Location.Address" type="text" name="Location.Address" id="Location_Address" class="form-control"
|
||||
data-val-required="Spécifier un lieu" >
|
||||
<span asp-validation-for="Location.Address" class="text-danger"></span>
|
||||
<ul id="loccomb">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="map" class="map" data-val="valloc" data-addr="Location_Address" data-loccombo="loccomb" data-lat="Location_Latitude" data-lon="Location_Longitude" ></div>
|
||||
|
||||
</div>
|
||||
<label asp-for="Reason" class="col-md-2 control-label">
|
||||
Donnez ici une raison à cette demande
|
||||
</label>
|
||||
<div class="col-md-10">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class='col-sm-6'>
|
||||
<div id='reason1'>
|
||||
<textarea rows="15" asp-for="Reason" type="text" name="Reason" id="Reason" maxlength="4096" class="form-control"></textarea>
|
||||
<span asp-validation-for="Reason" class="text-danger"></span>
|
||||
@Html.HiddenFor(model=>model.Location.Latitude)
|
||||
@Html.HiddenFor(model=>model.Location.Longitude)
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
|
||||
<input type="submit" class="btn btn-default" value="Créer"></input>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@Html.HiddenFor(model=>model.ClientId)
|
||||
@Html.HiddenFor(model=>model.PerformerId)
|
||||
@Html.HiddenFor(model=>model.ActivityCode)
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
|
||||
@{ await Html.RenderPartialAsync("_MapScriptsPartial"); }
|
||||
|
28
src/Yavsc/Views/Command/Delete.cshtml
Normal file
28
src/Yavsc/Views/Command/Delete.cshtml
Normal file
@ -0,0 +1,28 @@
|
||||
@model RdvQuery
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>Command</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.ValidationDate)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.ValidationDate)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<div class="form-actions no-color">
|
||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
17
src/Yavsc/Views/Command/Details.cshtml
Normal file
17
src/Yavsc/Views/Command/Details.cshtml
Normal file
@ -0,0 +1,17 @@
|
||||
@model RdvQuery
|
||||
|
||||
@{
|
||||
ViewData["Title"] = @SR["Details"];
|
||||
}
|
||||
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
|
||||
<div>
|
||||
<h4>@SR["Command"]</h4>
|
||||
<hr />
|
||||
@Html.DisplayFor(m=>m)
|
||||
</div>
|
||||
<p>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</p>
|
33
src/Yavsc/Views/Command/Edit.cshtml
Normal file
33
src/Yavsc/Views/Command/Edit.cshtml
Normal file
@ -0,0 +1,33 @@
|
||||
@model RdvQuery
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<div class="form-horizontal">
|
||||
<h4>Command</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="ValidationDate" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="ValidationDate" class="form-control" />
|
||||
<span asp-validation-for="ValidationDate" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Save" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
59
src/Yavsc/Views/Command/Index.cshtml
Normal file
59
src/Yavsc/Views/Command/Index.cshtml
Normal file
@ -0,0 +1,59 @@
|
||||
@model IEnumerable<RdvQuery>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>
|
||||
@SR["DateCreated"]
|
||||
</th>
|
||||
<th>
|
||||
@SR["EventDate"]
|
||||
</th>
|
||||
<th>
|
||||
@SR["Location"]
|
||||
</th>
|
||||
<th>
|
||||
@SR["Client"]
|
||||
</th>
|
||||
<th>
|
||||
@SR["Performer"]
|
||||
</th>
|
||||
<th>
|
||||
@SR["ValidationDate"]
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.DateCreated)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.EventDate)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Location.Address)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Client.UserName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.PerformerProfile.Performer.UserName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ValidationDate)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
Reference in New Issue
Block a user