- IT WORKS!
- Database operational: org#1 is
- Translations operational #1:
- Translations operational #2:
- Forcing build, again
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Site5/Default.aspx.cs b/Site5/Default.aspx.cs
index a0fc8354..3d02d747 100644
--- a/Site5/Default.aspx.cs
+++ b/Site5/Default.aspx.cs
@@ -3,13 +3,29 @@ using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
-using Activizr.Logic.Structure;
-public partial class _Default : System.Web.UI.Page
+public partial class Default : PageV5Base
{
+ public Default()
+ {
+ }
+
protected void Page_Load(object sender, EventArgs e)
{
- LabelOrgOne.Text = Organization.FromIdentity(1).Name;
- LabelTranslation2.Text = Resources.Pages.Global.CurrentUserInfo_SelectLanguage;
+ this.PageTitle = Resources.Pages.Global.Dashboard_PageTitle;
+ this.PageIcon = "iconshock-steering-wheel";
+
+ this.LabelActionListMotions.Text = Resources.Pages.Governance.ListMotions_PageTitle;
+ this.LabelActionVote.Text = Resources.Pages.Governance.Vote_PageTitle;
+
+ this.LabelSidebarInfo.Text = Resources.Pages.Global.Sidebar_Information;
+ this.LabelSidebarActions.Text = Resources.Pages.Global.Sidebar_Actions;
+ this.LabelSidebarTodo.Text = Resources.Pages.Global.Sidebar_Todo;
+
+ this.LabelActionItemsHere.Text = Resources.Pages.Global.Sidebar_Actions_Placeholder;
+ this.LabelGoThere.Text = Resources.Pages.Global.Global_GoThere;
+ this.LabelDashboardTemporaryContent.Text = Resources.Pages.Global.Dashboard_Main_Temporary;
+ this.LabelDashboardInfo.Text = Resources.Pages.Global.Dashboard_Info_Temporary;
+ this.LabelGoThere2.Text = Resources.Pages.Global.Global_GoThere;
}
-}
\ No newline at end of file
+}
diff --git a/Site5/Global.asax b/Site5/Global.asax
new file mode 100644
index 00000000..57bc49f7
--- /dev/null
+++ b/Site5/Global.asax
@@ -0,0 +1,81 @@
+<%@ Application Language="C#" %>
+<%@ Import Namespace="System.Globalization" %>
+<%@ Import Namespace="System.Collections.Generic" %>
+<%@ Import Namespace="System.Security.Principal" %>
+<%@ Import Namespace="System.Threading" %>
+<%@ Import Namespace="Activizr.Logic" %>
+
+
+
diff --git a/Site5/Master-v5.master b/Site5/Master-v5.master
new file mode 100644
index 00000000..77e119bd
--- /dev/null
+++ b/Site5/Master-v5.master
@@ -0,0 +1,203 @@
+<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Master-v5.master.cs" Inherits="Activizr.MasterV5" %>
+<%@ Register Src="~/Controls/v5/Base/LanguageSelector.ascx" TagName="LanguageSelector" TagPrefix="act5" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activizr - Pirate Edition
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Site5/Master-v5.master.cs b/Site5/Master-v5.master.cs
new file mode 100644
index 00000000..bbca6bc8
--- /dev/null
+++ b/Site5/Master-v5.master.cs
@@ -0,0 +1,286 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Web.Security;
+using Activizr.Logic.Pirates;
+using Activizr.Logic.Security;
+using Activizr.Logic.Structure;
+using Telerik.Web.UI;
+
+namespace Activizr
+{
+ public partial class MasterV5 : MasterV5Base
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ // Event subscriptions
+
+ this.LanguageSelector.LanguageChanged += new EventHandler(LanguageSelector_LanguageChanged);
+
+ // Titles etc
+
+ this.IconPage.ImageUrl = "/Images/PageIcons/" + this.CurrentPageIcon + "-40px.png";
+ this.LabelPageTitle.Text = this.CurrentPageTitle;
+ this.Page.Title = "Activizr - " + this.CurrentPageTitle;
+
+ // Check for SSL and force it
+
+ if (!Request.IsSecureConnection)
+ {
+ if (!Request.Url.ToString().StartsWith("http://dev.activizr.com/") && !Request.Url.ToString().StartsWith("http://localhost:"))
+ {
+ Response.Redirect(Request.Url.ToString().Replace("http:", "https:"));
+ }
+ }
+
+ Localize();
+
+ // Current authentication
+
+ string identity = HttpContext.Current.User.Identity.Name;
+ string[] identityTokens = identity.Split(',');
+
+ string userIdentityString = identityTokens[0];
+ string organizationIdentityString = identityTokens[1];
+
+ int currentUserId = Convert.ToInt32(userIdentityString);
+ int currentOrganizationId = Convert.ToInt32(organizationIdentityString);
+
+ this.LabelCurrentUserName.Text = Person.FromIdentity(currentUserId).Name;
+ this.LabelCurrentOrganizationName.Text = Organization.FromIdentity(currentOrganizationId).Name;
+
+ // Security stuff
+
+ _viewingPerson = Person.FromIdentity(currentUserId);
+ _authority = _viewingPerson.GetAuthority();
+
+ RadMenu mainMenu = FindControl("MainMenu") as RadMenu;
+
+ Dictionary
enableCache = new Dictionary();
+
+ if (Session["MainMenu-v4_Enabling"] != null
+ && PermissionCacheTimestamp.AddSeconds(10) > DateTime.Now
+ && Authorization.lastReload < PermissionCacheTimestamp)
+ {
+ enableCache = Session["MainMenu-v4_Enabling"] as Dictionary;
+ }
+ else
+ {
+ PermissionCacheTimestamp = DateTime.Now;
+ }
+
+ SetupMenuItems();
+
+ Authorization.flagReload = false;
+ // SetupMenuItemsEnabling(authority, enableCache, menuItems);
+ Session["MainMenu-v4_Enabling"] = enableCache;
+
+ this.ImageCultureIndicator.Style[HtmlTextWriterStyle.MarginTop] = "3px";
+ this.ImageCultureIndicator.Style[HtmlTextWriterStyle.MarginRight] = "3px";
+ this.ImageCultureIndicator.Style[HtmlTextWriterStyle.Cursor] = "pointer";
+ }
+
+ private Person _viewingPerson;
+ private Authority _authority;
+
+
+ private void Localize()
+ {
+ string cultureString = Thread.CurrentThread.CurrentCulture.ToString();
+ string cultureStringLower = cultureString.ToLowerInvariant();
+
+ string flagName = "uk";
+
+ if (cultureStringLower != "en-us" && cultureString.Length > 3)
+ {
+ flagName = cultureStringLower.Substring(3);
+ }
+
+ this.ImageCultureIndicator.ImageUrl = "~/Images/Flags/" + flagName + ".png";
+
+ this.LinkLogout.Text = Resources.Pages.Global.CurrentUserInfo_Logout;
+ this.LabelPreferences.Text = Resources.Pages.Global.CurrentUserInfo_Preferences;
+
+ if (cultureStringLower != "en-us" && cultureStringLower != "sv-se" && cultureString.Trim().Length > 0)
+ {
+ this.LinkTranslate.Visible = true;
+ }
+ else
+ {
+ this.LinkTranslate.Visible = false;
+ }
+ }
+
+ private void SetupMenuItems()
+ {
+ RadMenuItemCollection menuItems = this.MainMenu.Items;
+ SetupMenuItemsRecurse(menuItems, true);
+ }
+
+ private bool SetupMenuItemsRecurse(RadMenuItemCollection menuItems, bool topLevel)
+ {
+ // string thisPageUrl = Request.Url.Segments[Request.Url.Segments.Length - 1].ToLower();
+ bool anyItemEnabled = false;
+
+ foreach (RadMenuItem item in menuItems)
+ {
+ int itemUserLevel = Convert.ToInt32(item.Attributes["UserLevel"]);
+ string authorization = item.Attributes["Permission"];
+ string resourceKey = item.Attributes["GlobalResourceKey"];
+ string url = item.NavigateUrl;
+
+ item.Visible = itemUserLevel <= 4;
+
+ if (item.IsSeparator)
+ {
+ continue;
+ }
+
+ item.Text = GetGlobalResourceObject("Menu5", resourceKey).ToString();
+
+ bool enabled = topLevel;
+
+ if (item.Visible)
+ {
+ enabled |= SetupMenuItemsRecurse(item.Items, false);
+ enabled |= !String.IsNullOrEmpty(url);
+ }
+
+ item.Enabled = enabled;
+ if (enabled)
+ {
+ anyItemEnabled = true;
+ }
+ }
+
+ return anyItemEnabled;
+ }
+
+
+ /*
+ if (Convert.ToInt32(item.Attributes["UserLevel"]) < 4) // TODO: user's menu level
+ {
+ item.Visible = false;
+ }*/
+
+ /*
+ item.Enabled = true;
+ if (string.IsNullOrEmpty(item.Attributes["Permission"]) == false)
+ {
+ string permString = item.Attributes["Permission"].ToString();
+ PermissionSet allowedFor = new PermissionSet(permString);
+ }
+ else
+ {
+ RadMenuItem permissionParent = item;
+ while (permissionParent.Parent is RadMenuItem)
+ {
+ if (string.IsNullOrEmpty(permissionParent.Attributes["Permission"]) == false)
+ {
+ item.Enabled = permissionParent.Enabled;
+ item.Attributes["Permission"] = permissionParent.Attributes["Permission"].ToString();
+ break;
+ }
+ permissionParent = permissionParent.Parent as RadMenuItem;
+ }
+ }
+ if (string.IsNullOrEmpty(item.NavigateUrl) && item.Items.Count == 0)
+ {
+ item.Enabled = false;
+ }*/
+
+ /*
+ string[] currentItemUrlSplit = item.NavigateUrl.ToLower().Split(new char[] { '/', '?' }, StringSplitOptions.RemoveEmptyEntries);
+ if (Array.Exists(currentItemUrlSplit,
+ delegate(String s) { if (s == thisPageUrl) return true; else return false; })
+ )
+ {
+ if (string.IsNullOrEmpty(item.Attributes["Permission"]) == false)
+ {
+ string permString = item.Attributes["Permission"].ToString();
+ ((PageV5Base)(this.Page)).pagePermissionDefault = new PermissionSet(permString);
+ }
+ }
+ if (item.Items.Count > 0)
+ {
+ bool enabledSubItems = SetupMenuItemsEnabling(authority, enableCache, item.Items);
+ if (enabledSubItems)
+ {
+ item.Enabled = true;
+ }
+ else
+ {
+ item.Enabled = false;
+ }
+ }
+ else if (string.IsNullOrEmpty(item.NavigateUrl))
+ {
+ item.Enabled = false;
+ }*/
+
+
+
+
+ string CollectItemID(IRadMenuItemContainer item)
+ {
+ if (item.Owner == null)
+ {
+ return "";
+ }
+ else
+ {
+ return CollectItemID(item.Owner) + "_" + ((RadMenuItem)item).ID;
+ }
+ }
+
+
+ protected void Page_Init(object sender, EventArgs e)
+ {
+ }
+
+ protected void LinkLogout_Click(object sender, EventArgs e)
+ {
+ FormsAuthentication.SignOut();
+ FormsAuthentication.RedirectToLoginPage();
+ }
+
+ public event EventHandler LanguageChanged;
+
+ private void LanguageSelector_LanguageChanged(object sender, EventArgs e)
+ {
+ // Received event from control - refire
+
+ _viewingPerson.PreferredCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
+ this.LiteralCrowdinScript.Text = string.Empty;
+
+ if (LanguageChanged != null)
+ {
+ LanguageChanged(this, new EventArgs());
+ }
+ }
+
+ protected void LinkTranslate_Click(object sender, EventArgs e)
+ {
+ string crowdinCode =
+ "\r\n" +
+ "\r\n" +
+ "\r\n" +
+ "\r\n";
+
+ this.LiteralCrowdinScript.Text = crowdinCode;
+ // Page.ClientScript.RegisterStartupScript(this.GetType(), "crowdin", crowdinCode, false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Site5/favicon.ico b/Site5/favicon.ico
new file mode 100644
index 00000000..1d35c58e
Binary files /dev/null and b/Site5/favicon.ico differ
diff --git a/Site5/web.config b/Site5/web.config
index f0d73ac1..e8692907 100644
--- a/Site5/web.config
+++ b/Site5/web.config
@@ -42,6 +42,12 @@
+
+
+
+
+
+