HelpPages.cshtml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. @{
  2. Layout = "~/Views/Shared/_FunctionLayout.cshtml";
  3. }
  4. @model IEnumerable<GreenTree.Nachtragsmanagement.Web.Models.Misc.HelpPageDataModel>
  5. <script src='@Url.Content("~/Scripts/jquery.mCustomScrollbar.concat.min.js")'></script>
  6. <script>
  7. var deleteId;
  8. var saveOperation;
  9. $(document).ready(function () {
  10. setTimeout(function () {
  11. setHelpContentHeight();
  12. @if (ViewData["InitialEditHelpPage"] != null)
  13. {
  14. ViewContext.Writer.Write("editHelpPage(" + (int)ViewData["InitialEditHelpPage"] + ");");
  15. }
  16. }, 500);
  17. });
  18. $(window).resize(function () {
  19. setHelpContentHeight();
  20. });
  21. function setHelpContentHeight() {
  22. var height = $(window).height();
  23. $("#helpPageNavigation").height(height - 60);
  24. $("#helpPageContent").height(height - 32);
  25. if (typeof devHelpPageHtmlContentEditor !== 'undefined') {
  26. devHelpPageHtmlContentEditor.SetHeight(height);
  27. }
  28. }
  29. function viewHelpPage(id) {
  30. if (!id) return;
  31. $.ajax({
  32. url: '@Url.Action("ViewHelpPage", "Misc")',
  33. data: { Id: id },
  34. success: function (response) {
  35. $("#helpPageContent").html(response);
  36. },
  37. error: function () {
  38. alert("error occured");
  39. }
  40. });
  41. }
  42. function editHelpPage(id) {
  43. if (!id) return;
  44. $.ajax({
  45. url: '@Url.Action("EditHelpPage", "Misc")',
  46. data: { Id: id },
  47. success: function (response) {
  48. setTimeout(function () {
  49. $("#helpPageContent").html(response);
  50. devHelpPageHtmlContentEditor.SetHeight($("#helpPageContent").height() - 1);
  51. }, 200);
  52. },
  53. error: function () {
  54. alert("error occured");
  55. }
  56. });
  57. }
  58. function saveDataCallback() {
  59. devPopupControlEditHelpPage.Hide();
  60. }
  61. function confirmDelete(id) {
  62. if (!id) return;
  63. deleteId = id;
  64. $.ajax({
  65. type: "GET",
  66. url: '@Url.Action("GetHelpPage", "Misc")',
  67. data: { Id: id },
  68. success: function (response) {
  69. if (response == "notFound") return;
  70. var helpPage = JSON.parse(response);
  71. var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteHelpPage);
  72. popupControl.SetHeaderText(popupControl.GetHeaderText().replace("{helpPage}", helpPage.Title));
  73. $(".dialogText").text($(".dialogText").text().replace("{helpPage}", helpPage.Title));
  74. popupControl.Show();
  75. }
  76. });
  77. }
  78. function deleteHelpPage() {
  79. $.ajax({
  80. type: "POST",
  81. url: '@Url.Action("DeleteHelpPage", "Misc")',
  82. data: { Id: deleteId },
  83. success: function (response) {
  84. var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteHelpPage);
  85. popupControl.Hide();
  86. setTimeout(function () {
  87. window.location = window.location;
  88. }, 200);
  89. },
  90. error: function () {
  91. alert("error occured");
  92. }
  93. });
  94. }
  95. </script>
  96. <link rel="stylesheet" type="text/css" href='@Url.Content("~/Content/jquery.mCustomScrollbar.min.css")' />
  97. <style>
  98. .helpTable {
  99. width: 100%;
  100. }
  101. .helpTable > tbody > tr > td {
  102. vertical-align: top;
  103. }
  104. .helpTable > tbody > tr > td:first-of-type {
  105. padding-right: 12px;
  106. }
  107. .helpTable > tbody > tr > td:last-of-type {
  108. padding-left: 12px;
  109. }
  110. .helpPageMenu {
  111. width: auto;
  112. margin: 0 8px 6px 0;
  113. padding-bottom: 6px;
  114. border-bottom: 1px dashed #009688;
  115. overflow: auto;
  116. }
  117. #helpPageNavigation {
  118. border-right: 1px solid #009688;
  119. }
  120. #helpPageContent {
  121. color: black;
  122. overflow: auto !important;
  123. }
  124. </style>
  125. <table class="helpTable">
  126. <tr>
  127. <td style="width: 20%; min-width: 313px">
  128. <div class="helpPageMenu">
  129. @Html.DevExpress().Button(b =>
  130. {
  131. b.Name = "devButtonNewHelpPage";
  132. b.Text = "Neu";
  133. b.UseSubmitBehavior = false;
  134. //b.RenderMode = ButtonRenderMode.Link;
  135. b.ClientSideEvents.Click = "function (s, e) { editHelpPage(-1); }";
  136. }).GetHtml()
  137. </div>
  138. <div id="helpPageNavigation" class="mCustomScrollbar" data-mcs-theme="minimal-dark" style="width: 100%">
  139. @Html.Partial("~/Views/Misc/_HelpPageTreePartial.cshtml", Model)
  140. </div>
  141. </td>
  142. <td style="width: 80%">
  143. <div id="helpPageContent" style="width: 100%">
  144. </div>
  145. </td>
  146. </tr>
  147. </table>
  148. @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
  149. {
  150. PopupName = "devPopupControlDeleteHelpPage",
  151. Content = "<div class='dialogText' style='padding: 12px'>Sind Sie sicher, dass Sie die Hilfe-Seite \"{helpPage}\" löschen möchten?</div>",
  152. HeaderText = "\"{helpPage}\" löschen",
  153. YesFunction = "function (s, e) { deleteHelpPage(); }"
  154. })