Selaa lähdekoodia

- Fehler behoben, der lange Kommentare für VAs in der Baustellenliste nicht angezeigt hat.
- Es werden nur noch Plugins angezeigt, dessen Routen auch wirklich existieren (z.B. bei inkompatiblen Plugins)
- Version erhöht auf 1.0.0.4

Arne Diekmann 7 vuotta sitten
vanhempi
commit
a73cbfde44

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

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

+ 57 - 42
GreenTree.Nachtragsmanagement.Web/Views/Home/Index.cshtml

@@ -44,12 +44,15 @@
 	{
 		foreach (var i in g.Value)
 		{
-			ViewContext.Writer.WriteLine("popupNames.push(\"" + i.Name + "\");");
-			ViewContext.Writer.WriteLine("popupElements[\"" + i.Name + "\"] = \"" + i.Name + "_PW-1\";");
-			ViewContext.Writer.WriteLine("popupImages[\"" + i.Name + "\"] = \"" + Url.Content(i.ImageUrl) + "\";");
-			ViewContext.Writer.WriteLine("popupDescriptions[\"" + i.Name + "\"] = \"" + i.Description + "\";");
-			ViewContext.Writer.WriteLine("popupUrls[\"" + i.Name + "\"] = \"" + Url.RouteUrl(i.RouteName) + "\";");
-			ViewContext.Writer.WriteLine("popupMaxOnStartup[\"" + i.Name + "\"] = " + (i.MaximizedOnStart.HasValue ? i.MaximizedOnStart.Value.ToString().ToLower() : "false") + ";");
+			if (Url.RouteCollection[i.RouteName] != null)
+			{ 
+				ViewContext.Writer.WriteLine("popupNames.push(\"" + i.Name + "\");");
+				ViewContext.Writer.WriteLine("popupElements[\"" + i.Name + "\"] = \"" + i.Name + "_PW-1\";");
+				ViewContext.Writer.WriteLine("popupImages[\"" + i.Name + "\"] = \"" + Url.Content(i.ImageUrl) + "\";");
+				ViewContext.Writer.WriteLine("popupDescriptions[\"" + i.Name + "\"] = \"" + i.Description + "\";");
+				ViewContext.Writer.WriteLine("popupUrls[\"" + i.Name + "\"] = \"" + Url.RouteUrl(i.RouteName) + "\";");
+				ViewContext.Writer.WriteLine("popupMaxOnStartup[\"" + i.Name + "\"] = " + (i.MaximizedOnStart.HasValue ? i.MaximizedOnStart.Value.ToString().ToLower() : "false") + ";");
+			}
 		}
 	}
 
@@ -376,36 +379,39 @@
 	{
 		foreach (var i in g.Value)
 		{
-			Html.DevExpress().PopupControl(s =>
+			if (Url.RouteCollection[i.RouteName] != null)
 			{
-				s.Name = i.Name + "-Popup";
-				s.HeaderText = i.Description;
-				s.SetHeaderTemplateContent(
-					"<div class=\"functionHeader\">" +
-						"<img class=\"headerIcon\" src=\"" + Url.Content(i.ImageUrl) + "\" />" +
-						"<span class=\"headerText\">" + i.Description + "</span>" +
-						"<div class=\"controlContainer\">" +
-						"<img class=\"controlIcon\" src=\"" +
-							Url.Content("~/Content/Images/minimize-16.png") + "\" onclick=\"hideFunction('" + i.Name + "',true);\" />" +
-						"<img class=\"controlIcon\" src=\"" +
-							Url.Content("~/Content/Images/maximize-16.png") + "\" onclick=\"toggleMaximizeFunction('" + i.Name + "');\" />" +
-						"<img class=\"controlIcon\" src=\"" +
-							Url.Content("~/Content/Images/fullScreen-16.png") + "\" onclick=\"toggleFullscreenFunction('" + i.Name + "',this);\" />" +
-						"<img class=\"controlIcon\" src=\"" +
-							Url.Content("~/Content/Images/close-16.png") + "\" onclick=\"hideFunction('" + i.Name + "',false);\" />" +
-						"</div>" +
-					"</div>");
-				s.ContentUrl = Url.RouteUrl(i.RouteName);
-				s.Modal = false;
-				s.ShowMaximizeButton = (i.AllowMaximize.HasValue && i.AllowMaximize.Value) ? true : false;
-				s.Width = new Unit(i.BaseWidth.Value, UnitType.Pixel);
-				s.Height = new Unit(i.BaseHeight.Value, UnitType.Pixel);
-				s.MinWidth = new Unit(i.MinWidth.Value, UnitType.Pixel);
-				s.MinHeight = new Unit(i.MinHeight.Value, UnitType.Pixel);
-				s.CloseAction = CloseAction.None;
-				s.AllowDragging = false;
-				s.Styles.Header.CssClass += "devExAllowDrag";
-			}).GetHtml();
+				Html.DevExpress().PopupControl(s =>
+				{
+					s.Name = i.Name + "-Popup";
+					s.HeaderText = i.Description;
+					s.SetHeaderTemplateContent(
+						"<div class=\"functionHeader\">" +
+							"<img class=\"headerIcon\" src=\"" + Url.Content(i.ImageUrl) + "\" />" +
+							"<span class=\"headerText\">" + i.Description + "</span>" +
+							"<div class=\"controlContainer\">" +
+							"<img class=\"controlIcon\" src=\"" +
+								Url.Content("~/Content/Images/minimize-16.png") + "\" onclick=\"hideFunction('" + i.Name + "',true);\" />" +
+							"<img class=\"controlIcon\" src=\"" +
+								Url.Content("~/Content/Images/maximize-16.png") + "\" onclick=\"toggleMaximizeFunction('" + i.Name + "');\" />" +
+							"<img class=\"controlIcon\" src=\"" +
+								Url.Content("~/Content/Images/fullScreen-16.png") + "\" onclick=\"toggleFullscreenFunction('" + i.Name + "',this);\" />" +
+							"<img class=\"controlIcon\" src=\"" +
+								Url.Content("~/Content/Images/close-16.png") + "\" onclick=\"hideFunction('" + i.Name + "',false);\" />" +
+							"</div>" +
+						"</div>");
+					s.ContentUrl = Url.RouteUrl(i.RouteName);
+					s.Modal = false;
+					s.ShowMaximizeButton = (i.AllowMaximize.HasValue && i.AllowMaximize.Value) ? true : false;
+					s.Width = new Unit(i.BaseWidth.Value, UnitType.Pixel);
+					s.Height = new Unit(i.BaseHeight.Value, UnitType.Pixel);
+					s.MinWidth = new Unit(i.MinWidth.Value, UnitType.Pixel);
+					s.MinHeight = new Unit(i.MinHeight.Value, UnitType.Pixel);
+					s.CloseAction = CloseAction.None;
+					s.AllowDragging = false;
+					s.Styles.Header.CssClass += "devExAllowDrag";
+				}).GetHtml();
+			}
 		}
 	}
 
@@ -430,6 +436,12 @@
 
 					foreach (var g in Model.AvailableFunctions)
 					{
+						var hasFunctions = 
+							g.Value
+								.Any(i => Url.RouteCollection[i.RouteName] != null);
+
+						if (!hasFunctions) continue;
+
 						s.Groups.Add(n1 =>
 						{
 							n1.Name = g.Key.Name;
@@ -438,13 +450,16 @@
 
 							foreach (var i in g.Value)
 							{
-								n1.Items.Add(n2 =>
-								{
-									n2.Name = i.Name;
-									n2.Text = i.Description;
-									n2.Image.Url = i.ImageUrl;
-									n2.Image.UrlHottracked = GreenTree.Nachtragsmanagement.Core.StaticHelper.AddSuffix(i.ImageUrl, "-contrast", true);
-								});
+								if (Url.RouteCollection[i.RouteName] != null)
+								{ 
+									n1.Items.Add(n2 =>
+									{
+										n2.Name = i.Name;
+										n2.Text = i.Description;
+										n2.Image.Url = i.ImageUrl;
+										n2.Image.UrlHottracked = GreenTree.Nachtragsmanagement.Core.StaticHelper.AddSuffix(i.ImageUrl, "-contrast", true);
+									});
+								}
 							}
 						});
 					}

+ 1 - 1
GreenTree.Nachtragsmanagement.Web/Views/Sites/_SiteEditTreePartial.cshtml

@@ -121,7 +121,7 @@
 				if (treeKey.StartsWith("a"))
 					ViewContext.Writer.Write("<a href=\"#\" onclick='showComment(\"appendix\"," + id + ",this)'><br />Anzeigen</a>");
 				else
-					ViewContext.Writer.Write("<a href=\"#\" onclick='showComment(\"appendix\"," + id + ",this)'><br />Anzeigen</a>");
+					ViewContext.Writer.Write("<a href=\"#\" onclick='showComment(\"deviation\"," + id + ",this)'><br />Anzeigen</a>");
 			}
 			else
 				ViewContext.Writer.Write(text);