Create.cshtml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 btn-bar">
  48. <a href=@Url.Action("Details", "ActionsEdu", new { id = actionEduActeur.ActionEduId }) class="btn btn-default">Annuler</a>
  49. <input type="submit" value="Enregistrer" class="btn btn-primary" />
  50. </div>
  51. </div>
  52. }
  53. @section Scripts {
  54. <script type="text/javascript">
  55. $.event.special.inputchange = {
  56. setup: function () {
  57. var self = this, val;
  58. $.data(this, 'timer', window.setInterval(function () {
  59. val = self.value;
  60. if ($.data(self, 'cache') != val) {
  61. $.data(self, 'cache', val);
  62. $(self).trigger('inputchange');
  63. }
  64. }, 20));
  65. },
  66. teardown: function () {
  67. window.clearInterval($.data(this, 'timer'));
  68. },
  69. add: function () {
  70. $.data(this, 'cache', this.value);
  71. }
  72. };
  73. $("#actionEduActeur_Sid").on('inputchange', function () {
  74. $("#actionEduActeur_nom").prop("readonly", true);
  75. });
  76. </script>
  77. @Scripts.Render("~/bundles/jqueryval")
  78. }