Create.cshtml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. @using CD67.FicheCollege.MVC.Models
  2. @model ActionEduActeurViewModel
  3. @{
  4. ViewBag.Title = "Création";
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. ActionEduActeur actionEduActeur = Model.Obj;
  7. }
  8. <header>
  9. <h2>Action '@actionEduActeur.ActionEdu.Nom': Ajouter un acteur</h2>
  10. </header>
  11. @using (Html.BeginForm())
  12. {
  13. @Html.AntiForgeryToken()
  14. <div class="form-horizontal">
  15. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  16. @Html.HiddenFor(model => actionEduActeur.Id)
  17. @Html.HiddenFor(model => actionEduActeur.ActionEduId)
  18. <div class="form-group">
  19. @Html.LabelFor(model => actionEduActeur.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
  20. <div class="col-md-10">
  21. <input id="actionEduActeur_nom" class="form-control picker" name="actionEduActeur.nom" data-picker="structure.description">
  22. @Html.ValidationMessageFor(model => actionEduActeur.Nom, "", new { @class = "text-danger" })
  23. <input id="actionEduActeur_Sid" name="actionEduActeur.Sid" class="picker" value="" data-picker="structure.id" type="hidden">
  24. <div>
  25. <p>
  26. <a class="modal-window cboxElement" href="http://referentiel.bas-rhin.fr/picker/cd67/org67/" title="Selection structure (nouvelle fenetre)">
  27. Sélectionner un service ou une mission du CD67
  28. </a>
  29. </p>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. @Html.LabelFor(model => actionEduActeur.RoleId, htmlAttributes: new { @class = "control-label col-md-2" })
  35. <div class="col-md-10">
  36. @Html.DropDownListFor(model => actionEduActeur.RoleId, Model.Sel_Role, htmlAttributes: new { @class = "form-control" })
  37. @Html.ValidationMessageFor(model => actionEduActeur.RoleId, "", new { @class = "text-danger" })
  38. </div>
  39. </div>
  40. <div class="form-group">
  41. @Html.LabelFor(model => actionEduActeur.Commentaire, htmlAttributes: new { @class = "control-label col-md-2" })
  42. <div class="col-md-10">
  43. @Html.EditorFor(model => actionEduActeur.Commentaire, new { htmlAttributes = new { @class = "form-control" } })
  44. @Html.ValidationMessageFor(model => actionEduActeur.Commentaire, "", new { @class = "text-danger" })
  45. </div>
  46. </div>
  47. <div class="form-group">
  48. <span class="col-md-offset-2 col-md-4">
  49. <input type="submit" value="Créer" class="btn btn-default" />
  50. </span>
  51. <span class="col-md-4">
  52. <a href="@Url.Action("Details", "ActionsEdu", new { id = actionEduActeur.ActionEduId })">Annuler</a>
  53. </span>
  54. </div>
  55. </div>
  56. }
  57. @section Scripts {
  58. <script type="text/javascript">
  59. $.event.special.inputchange = {
  60. setup: function () {
  61. var self = this, val;
  62. $.data(this, 'timer', window.setInterval(function () {
  63. val = self.value;
  64. if ($.data(self, 'cache') != val) {
  65. $.data(self, 'cache', val);
  66. $(self).trigger('inputchange');
  67. }
  68. }, 20));
  69. },
  70. teardown: function () {
  71. window.clearInterval($.data(this, 'timer'));
  72. },
  73. add: function () {
  74. $.data(this, 'cache', this.value);
  75. }
  76. };
  77. $("#actionEduActeur_Sid").on('inputchange', function () {
  78. $("#actionEduActeur_nom").prop("readonly", true);
  79. });
  80. </script>
  81. @Scripts.Render("~/bundles/jqueryval")
  82. }