ソースを参照

Meldung für "Kein Update verfügbar" hinzugefügt!

Arne Diekmann 8 年 前
コミット
976357983d

+ 1 - 1
GreenTree.Nachtragsmanagement.Core/AppendixVersion.cs

@@ -15,7 +15,7 @@ namespace GreenTree.Nachtragsmanagement.Core
         {
             get
             {
-                return "0.9.1.2";
+                return "0.9.1.3";
             }
         }
     }

+ 4 - 2
GreenTree.Nachtragsmanagement.Web/Controllers/AdminController.cs

@@ -556,7 +556,6 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
         /// <summary>
         /// Update check
         /// </summary>
-        [HttpPost]
         public ActionResult PartialCheckUpdate()
         {
             _logger.Information("Updateüberprüfung gestartet.");
@@ -589,7 +588,10 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
                 else
                     _logger.Information("Es kein Update verfügbar!");
 
-                return PartialView("~/Views/Admin/AppInfo/_UpdateNotesPartial.cshtml", result);
+                if (result.IsUpdateAvailable)
+                    return PartialView("~/Views/Admin/AppInfo/_UpdateNotesPartial.cshtml", result);
+                else
+                    return PartialView("~/Views/Admin/AppInfo/_UpdateUnnecessaryPartial.cshtml");
             }
             catch (Exception ex)
             {

+ 1 - 0
GreenTree.Nachtragsmanagement.Web/GreenTree.Nachtragsmanagement.Web.csproj

@@ -376,6 +376,7 @@
     <Content Include="Views\Admin\Users\_UserSearchPartial.cshtml" />
     <Content Include="Views\Shared\_ChangePasswordPartial.cshtml" />
     <Content Include="Views\Admin\AppInfo\_UpdateNotesPartial.cshtml" />
+    <Content Include="Views\Admin\AppInfo\_UpdateUnnecessaryPartial.cshtml" />
     <None Include="Web.Debug.config">
       <DependentUpon>Web.config</DependentUpon>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

+ 0 - 1
GreenTree.Nachtragsmanagement.Web/Views/Admin/AppInfo/View.cshtml

@@ -15,7 +15,6 @@
 	function checkUpdate() {
 		devLoadingPanelUpdate.Show();
 		$.ajax({
-			method: "POST",
 			url: '@Url.Action("PartialCheckUpdate", "Admin")',
 			success: function (response) {
 				if (!response) return;

+ 44 - 0
GreenTree.Nachtragsmanagement.Web/Views/Admin/AppInfo/_UpdateUnnecessaryPartial.cshtml

@@ -0,0 +1,44 @@
+@using GreenTree.Nachtragsmanagement.Web.Models.Global;
+
+<div class="updateContainer">
+
+	@Html.DevExpress().PopupControl(s =>
+{
+	s.Name = "devPopupControlNoUpdate";
+	s.HeaderText = "Kein Update verfügbar";
+	s.Modal = true;
+	s.Width = new Unit(350, UnitType.Pixel);
+	s.CloseAction = CloseAction.CloseButton;
+	s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
+	s.PopupVerticalAlign = PopupVerticalAlign.WindowCenter;
+	s.AllowDragging = false;
+	s.AllowResize = false;
+	s.ShowFooter = false;
+	s.ShowOnPageLoad = true;
+	s.SetContent(() =>
+	{
+		ViewContext.Writer.Write(
+			"<div class='dialogText' style='padding: 12px'>" +
+				"<h2 style='text-align: center'>Es ist kein Update verfügbar!</h2>" +
+			"</div>");
+		Html.RenderPartial(
+			"~/Views/Shared/_PopupButtonPanelOption.cshtml",
+			new GreenTree.Nachtragsmanagement.Web.Models.Global.OptionDialogModel
+			{
+				OptionItems = new List<GreenTree.Nachtragsmanagement.Web.Models.Global.OptionDialogItemModel>
+				{
+					new GreenTree.Nachtragsmanagement.Web.Models.Global.OptionDialogItemModel
+					{
+						Name = "NoUpdateAccept",
+						Text = "Ok",
+						Function = "function (s, e) { devPopupControlNoUpdate.Hide(); }"
+					}
+				}
+			}
+		);
+	});
+	s.Styles.Content.Paddings.Padding = new Unit(0);
+	s.Styles.ModalBackground.Opacity = 0;
+}).GetHtml()
+
+</div>