From 2bf5c148c283369092d132cf5a731666eb40ca6b Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 10 Dec 2011 22:45:25 +0000 Subject: [PATCH] Committing display of build number (testing...) --- Activizr.sln | 43 --------------------------------------- Site5/Global.asax | 15 ++++++++++++++ Site5/Master-v5.master | 4 +++- Site5/Master-v5.master.cs | 9 +++++++- 4 files changed, 26 insertions(+), 45 deletions(-) diff --git a/Activizr.sln b/Activizr.sln index f51de621..ba2528d2 100644 --- a/Activizr.sln +++ b/Activizr.sln @@ -19,34 +19,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Basic", "Basic\Basic.csproj EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Backend", "Backend\Backend.csproj", "{B7C7320D-A721-4EA8-83E9-1B09AAFF20E9}" EndProject -Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Site5-Sep", "Site5-Sep\", "{DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}" - ProjectSection(WebsiteProperties) = preProject - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" - Debug.AspNetCompiler.VirtualPath = "/Site5-Sep" - Debug.AspNetCompiler.PhysicalPath = "Site5-Sep\" - Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\Site5-Sep\" - Debug.AspNetCompiler.Updateable = "true" - Debug.AspNetCompiler.ForceOverwrite = "true" - Debug.AspNetCompiler.FixedNames = "false" - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.VirtualPath = "/Site5-Sep" - Release.AspNetCompiler.PhysicalPath = "Site5-Sep\" - Release.AspNetCompiler.TargetPath = "PrecompiledWeb\Site5-Sep\" - Release.AspNetCompiler.Updateable = "true" - Release.AspNetCompiler.ForceOverwrite = "true" - Release.AspNetCompiler.FixedNames = "false" - Release.AspNetCompiler.Debug = "False" - VWDPort = "1780" - VWDVirtualPath = "/" - StartServerOnDebug = "false" - EndProjectSection - ProjectSection(ProjectDependencies) = postProject - {3A5B5F19-51A5-48CE-A82E-97D5C189E5CB} = {3A5B5F19-51A5-48CE-A82E-97D5C189E5CB} - {13E59551-34AC-43DC-9A03-EF5E4721DC61} = {13E59551-34AC-43DC-9A03-EF5E4721DC61} - {6608C2E6-F841-4CD1-8AB2-28DC3B1DDDD1} = {6608C2E6-F841-4CD1-8AB2-28DC3B1DDDD1} - {BA24FAF7-D518-49E8-952A-45595682877E} = {BA24FAF7-D518-49E8-952A-45595682877E} - EndProjectSection -EndProject Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Site5", "Site5\", "{367F36EA-AE1C-4E15-BAF9-BA75B18B3807}" ProjectSection(WebsiteProperties) = preProject TargetFrameworkMoniker = ".NETFramework,Version%3Dv2.0" @@ -196,21 +168,6 @@ Global {B7C7320D-A721-4EA8-83E9-1B09AAFF20E9}.Release|Any CPU.Build.0 = Release|Any CPU {B7C7320D-A721-4EA8-83E9-1B09AAFF20E9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {B7C7320D-A721-4EA8-83E9-1B09AAFF20E9}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Autobuild|.NET.ActiveCfg = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Autobuild|Any CPU.ActiveCfg = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Autobuild|Any CPU.Build.0 = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Autobuild|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Autobuild|Mixed Platforms.Build.0 = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Debug|.NET.ActiveCfg = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Release|.NET.ActiveCfg = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Release|Any CPU.Build.0 = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DAEDFA45-785C-4BC4-9330-87BE68FAE1E5}.Release|Mixed Platforms.Build.0 = Debug|Any CPU {367F36EA-AE1C-4E15-BAF9-BA75B18B3807}.Autobuild|.NET.ActiveCfg = Debug|Any CPU {367F36EA-AE1C-4E15-BAF9-BA75B18B3807}.Autobuild|Any CPU.ActiveCfg = Debug|Any CPU {367F36EA-AE1C-4E15-BAF9-BA75B18B3807}.Autobuild|Any CPU.Build.0 = Debug|Any CPU diff --git a/Site5/Global.asax b/Site5/Global.asax index 57bc49f7..3e5e1c40 100644 --- a/Site5/Global.asax +++ b/Site5/Global.asax @@ -1,6 +1,7 @@ <%@ Application Language="C#" %> <%@ Import Namespace="System.Globalization" %> <%@ Import Namespace="System.Collections.Generic" %> +<%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Security.Principal" %> <%@ Import Namespace="System.Threading" %> <%@ Import Namespace="Activizr.Logic" %> @@ -15,6 +16,20 @@ HttpContext.Current.Application["Cultures"] = new string[] { "sv-SE", "en-US", "de-DE", "de-AT", "fi-FI" }; HttpContext.Current.Application["UserRoleCache"] = new Dictionary(); + + // Read build number, or set to "Private" if none + + try + { + using (StreamReader reader = File.OpenText(HttpContext.Current.Request.MapPath("~/BuildIdentity.txt"))) + { + HttpContext.Current.Application["BuildIdentity"] = "Build " + reader.ReadLine(); + } + } + catch (Exception) + { + HttpContext.Current.Application["BuildIdentity"] = "Private Build"; + } } private void Application_End (object sender, EventArgs e) diff --git a/Site5/Master-v5.master b/Site5/Master-v5.master index 77e119bd..5b52b443 100644 --- a/Site5/Master-v5.master +++ b/Site5/Master-v5.master @@ -8,7 +8,7 @@ - + @@ -165,6 +165,8 @@ + + diff --git a/Site5/Master-v5.master.cs b/Site5/Master-v5.master.cs index bbca6bc8..a4a9c787 100644 --- a/Site5/Master-v5.master.cs +++ b/Site5/Master-v5.master.cs @@ -140,7 +140,14 @@ namespace Activizr continue; } - item.Text = GetGlobalResourceObject("Menu5", resourceKey).ToString(); + if (item.Text == "Build# Auto") + { + item.Text = (string) HttpContext.Current.Application["BuildIdentity"]; + } + else + { + item.Text = GetGlobalResourceObject("Menu5", resourceKey).ToString(); + } bool enabled = topLevel;