diff --git a/Site5/Controls/v5/Swarm/ComboPersonObsolete.ascx b/Site5/Controls/v5/Swarm/ComboPersonObsolete.ascx deleted file mode 100644 index cbc79aa8..00000000 --- a/Site5/Controls/v5/Swarm/ComboPersonObsolete.ascx +++ /dev/null @@ -1,8 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ComboPersonObsolete.ascx.cs" Inherits="Swarmops.Controls.Swarm.ComboPersonObsolete" %> - - - diff --git a/Site5/Controls/v5/Swarm/ComboPersonObsolete.ascx.cs b/Site5/Controls/v5/Swarm/ComboPersonObsolete.ascx.cs deleted file mode 100644 index c9827c2b..00000000 --- a/Site5/Controls/v5/Swarm/ComboPersonObsolete.ascx.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; -using System.Collections; -using System.Configuration; -using System.Data; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.HtmlControls; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using Swarmops.Basic.Types; -using Swarmops.Logic.Swarm; -using Swarmops.Logic.Security; -using Swarmops.Logic.Structure; -using Swarmops.Interface; -using Telerik.Web.UI; - -namespace Swarmops.Controls.Swarm -{ - - public partial class ComboPersonObsolete : ControlV5Base - { - protected void Page_Load(object sender, EventArgs e) - { - - } - - private const int initialItemCount = 50; - - protected void ComboControl_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) - { - People candidates = null; - - if (e.Text.Replace(" ", "").Length >= 4) - { - string pattern = e.Text; - int indexOfParenthesis = pattern.IndexOf('('); - - if (indexOfParenthesis > -1) - { - pattern = pattern.Substring(0, indexOfParenthesis); - } - - candidates = People.FromNamePattern(pattern); - } - - if (candidates == null) - { - candidates = new People(); - } - - candidates = candidates.GetVisiblePeopleByAuthority(_authority); - candidates.Sort(); - - int itemOffset = e.NumberOfItems; - int itemCount = Math.Min(itemOffset + initialItemCount, candidates.Count); - e.EndOfItems = (itemCount == candidates.Count ? true : false); - - for (int i = itemOffset; i < itemCount; i++) - { - string descriptionString = candidates[i].Canonical; - - RadComboBoxItem comboItem = new RadComboBoxItem(descriptionString, candidates[i].Identity.ToString()); - comboItem.ImageUrl = "/Images/Public/Fugue/icons-shadowless/" + - PersonIcon.ForPerson(candidates[i], Organizations.FromSingle(Organization.PPSE)).Image; - - this.ComboControl.Items.Add(comboItem); - } - - e.Message = GetStatusMessage(itemCount, candidates.Count); - } - - private static string GetStatusMessage(int offset, int total) - { - if (total <= 0) - return "No matches"; - - return String.Format("People 1-{0} out of {1}", offset, total); - } - - public string Text - { - get { return this.ComboControl.Text; } - set { this.ComboControl.Text = value; } - } - - public bool HasSelection - { - get { return this.ComboControl.SelectedValue.Trim().Length > 0 ? true : false; } - } - - public Person SelectedPerson - { - get - { - if (HasSelection) - { - return Person.FromIdentity(Int32.Parse(this.ComboControl.SelectedValue)); - } - else - { - return null; - } - } - set - { - if (value == null) - { - this.ComboControl.SelectedIndex = -1; - this.ComboControl.Text = string.Empty; - } - else - { - this.ComboControl.SelectedValue = value.Identity.ToString(); - this.ComboControl.Text = value.Canonical; - } - } - } - - protected void ComboControl_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) - { - if (this.SelectedPersonChanged != null) - { - SelectedPersonChanged(this, new EventArgs()); - } - } - - public int Width - { - set { this.ComboControl.Width = value; } - } - - public bool Enabled - { - set { this.ComboControl.Enabled = value; } - get { return this.ComboControl.Enabled; } - } - - public event EventHandler SelectedPersonChanged; - } -} \ No newline at end of file diff --git a/Site5/Controls/v5/Swarm/PersonDetailPopup.ascx b/Site5/Controls/v5/Swarm/PersonDetailPopup.ascx index 8c65c4c5..15694dc1 100644 --- a/Site5/Controls/v5/Swarm/PersonDetailPopup.ascx +++ b/Site5/Controls/v5/Swarm/PersonDetailPopup.ascx @@ -1,5 +1,4 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeFile="PersonDetailPopup.ascx.cs" Inherits="Swarmops.Controls.Swarm.PersonDetailPopup" %> -<%@ Register Src="~/Controls/v5/Swarm/ComboPersonObsolete.ascx" TagName="ComboPerson" TagPrefix="act5" %> @@ -11,7 +10,7 @@ - + diff --git a/Site5/Controls/v5/Swarm/PersonDetailPopup.ascx.cs b/Site5/Controls/v5/Swarm/PersonDetailPopup.ascx.cs index 99ddfbd8..2c2ac9c0 100644 --- a/Site5/Controls/v5/Swarm/PersonDetailPopup.ascx.cs +++ b/Site5/Controls/v5/Swarm/PersonDetailPopup.ascx.cs @@ -12,7 +12,6 @@ using Swarmops.Controls.Swarm; using Swarmops.Logic.Financial; using Swarmops.Logic.Swarm; using Swarmops.Logic.Security; -using Telerik.Web.UI; @@ -32,7 +31,7 @@ namespace Swarmops.Controls.Swarm } this.LabelPersonName.Style[HtmlTextWriterStyle.FontSize] = "20px"; - this.PersonNew.Width = 157; + // this.PersonNew.Width = 157; this.ButtonSetNew.Visible = this.Changeable; @@ -55,7 +54,7 @@ namespace Swarmops.Controls.Swarm { if (_person == null) { - return this.PersonNew.SelectedPerson; + // return this.PersonNew.SelectedPerson; } return _person; @@ -92,7 +91,7 @@ namespace Swarmops.Controls.Swarm { this.PanelRead.Visible = false; this.PanelWrite.Visible = true; - this.PersonNew.Focus(); + // this.PersonNew.Focus(); } public void Reset() @@ -100,7 +99,7 @@ namespace Swarmops.Controls.Swarm this.PanelWrite.Visible = false; this.PanelRead.Visible = true; this.ButtonConfirmPerson.Visible = false; - this.PersonNew.SelectedPerson = null; + // this.PersonNew.SelectedPerson = null; if (ViewState[this.ClientID + "_PersonId"] == null) { @@ -116,13 +115,13 @@ namespace Swarmops.Controls.Swarm protected void PersonNew_SelectedPersonChanged(object sender, EventArgs e) { - this.ImageAvatar.ImageUrl = this.PersonNew.SelectedPerson.GetSecureAvatarLink(96); + // this.ImageAvatar.ImageUrl = this.PersonNew.SelectedPerson.GetSecureAvatarLink(96); this.ButtonConfirmPerson.Visible = true; } protected void ButtonConfirmPerson_Click(object sender, EventArgs e) { - this._person = this.PersonNew.SelectedPerson; + // this._person = this.PersonNew.SelectedPerson; IOwnerSettable settableInterface = this.Cookie as IOwnerSettable; @@ -133,7 +132,7 @@ namespace Swarmops.Controls.Swarm if (PersonChanged != null) { - PersonChanged(this, new PersonChangedEventArgs(this.PersonNew.SelectedPerson, this.Cookie)); + // PersonChanged(this, new PersonChangedEventArgs(this.PersonNew.SelectedPerson, this.Cookie)); } this.LabelPersonName.Text = _person.Name; diff --git a/Site5/Master-v5.master b/Site5/Master-v5.master index 289b7366..0a5eedac 100644 --- a/Site5/Master-v5.master +++ b/Site5/Master-v5.master @@ -21,8 +21,7 @@ Swarmops - - + @@ -114,137 +113,6 @@ - @@ -304,16 +172,6 @@ - - - - diff --git a/Site5/Master-v5.master.cs b/Site5/Master-v5.master.cs index 4e93ebd5..d9a689e2 100644 --- a/Site5/Master-v5.master.cs +++ b/Site5/Master-v5.master.cs @@ -10,7 +10,6 @@ using System.Web.Security; using Swarmops.Logic.Swarm; using Swarmops.Logic.Security; using Swarmops.Logic.Structure; -using Telerik.Web.UI; using Membership = Swarmops.Logic.Swarm.Membership; @@ -42,7 +41,7 @@ namespace Swarmops { // Event subscriptions - this.LanguageSelector.LanguageChanged += new EventHandler(LanguageSelector_LanguageChanged); + // this.LanguageSelector.LanguageChanged += new EventHandler(LanguageSelector_LanguageChanged); // Titles and other page elements @@ -92,7 +91,7 @@ namespace Swarmops // Set up main menu - RadMenu mainMenu = FindControl("MainMenu") as RadMenu; + // RadMenu mainMenu = FindControl("MainMenu") as RadMenu; Dictionary enableCache = new Dictionary(); @@ -209,10 +208,11 @@ namespace Swarmops private void SetupMenuItems() { - RadMenuItemCollection menuItems = this.MainMenu.Items; - SetupMenuItemsRecurse(menuItems, true); + // 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(); @@ -279,7 +279,7 @@ namespace Swarmops } return anyItemEnabled; - } + }*/ private string GetBuildIdentity() { @@ -367,7 +367,7 @@ namespace Swarmops - + /* string CollectItemID(IRadMenuItemContainer item) { if (item.Owner == null) @@ -378,7 +378,7 @@ namespace Swarmops { return CollectItemID(item.Owner) + "_" + ((RadMenuItem)item).ID; } - } + }*/ protected void LinkLogout_Click(object sender, EventArgs e) diff --git a/Site5/OldTelerikMenu.txt b/Site5/OldTelerikMenu.txt new file mode 100644 index 00000000..640bf771 --- /dev/null +++ b/Site5/OldTelerikMenu.txt @@ -0,0 +1,131 @@ + diff --git a/Site5/Pages/v5/Governance/AddMotion.aspx b/Site5/Pages/v5/Governance/AddMotion.aspx deleted file mode 100644 index 76840ae3..00000000 --- a/Site5/Pages/v5/Governance/AddMotion.aspx +++ /dev/null @@ -1,70 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="AddMotion.aspx.cs" Inherits="Swarmops.Pages.Governance.AddMotion" %> - -<%@ Register src="~/Controls/v5/Swarm/ComboPersonObsolete.ascx" tagname="ComboPerson" tagprefix="act5" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Site5/Pages/v5/Governance/AddMotion.aspx.cs b/Site5/Pages/v5/Governance/AddMotion.aspx.cs deleted file mode 100644 index 1c92f07c..00000000 --- a/Site5/Pages/v5/Governance/AddMotion.aspx.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Swarmops.Logic.Swarm; -using Swarmops.Logic.Governance; - -namespace Swarmops.Pages.Governance -{ - - public partial class AddMotion : PageV5Base - { - private Meeting _meeting = Meeting.FromIdentity(1); - - protected void Page_Load(object sender, EventArgs e) - { - // Stylize - - this.PageIcon = "iconshock-motion-add"; - this.TextTitle.Style[HtmlTextWriterStyle.Width] = "300px"; - this.PersonSubmitter.Width = 304; // !? - this.TextMotionText.Style[HtmlTextWriterStyle.Width] = "300px"; - this.TextDecisionPoints.Style[HtmlTextWriterStyle.Width] = "300px"; - this.TextMotionText.Style[HtmlTextWriterStyle.Height] = "200px"; - - // Localize - - this.PageTitle = Resources.Pages.Governance.AddMotion_PageTitle; - - this.LabelMeetingName.Text = _meeting.Name; - this.LabelWrongMeeting.Text = Resources.Pages.Governance.AddMotion_WrongMeeting; - this.LabelSubmittingMotionInfo.Text = Resources.Pages.Governance.AddMotion_SubmittingMotionInfo; - this.LabelTitle.Text = Resources.Pages.Governance.AddMotion_Title; - this.LabelSubmitter.Text = Resources.Pages.Governance.AddMotion_Submitter; - this.LabelText.Text = Resources.Pages.Governance.AddMotion_Text; - this.LabelDecisions.Text = Resources.Pages.Governance.AddMotion_Decisions; - - this.LabelSidebarInfo.Text = Resources.Global.Sidebar_Information; - this.LabelSidebarActions.Text = Resources.Global.Sidebar_Actions; - this.LabelSidebarTodo.Text = Resources.Global.Sidebar_Todo; - this.LabelActionItemsHere.Text = Resources.Global.Sidebar_Todo_Placeholder; - - this.ButtonAddMotion.Text = Resources.Pages.Governance.AddMotion_SubmitMotion; - - this.LabelActionListMotions.Text = Resources.Pages.Governance.ListMotions_PageTitle; - - if (!Page.IsPostBack) - { - this.PersonSubmitter.SelectedPerson = CurrentUser; - - // HACK: Hardcode the presidency of this meeting - - bool isPresidency = false; - - switch (CurrentUser.Identity) - { - case 1681: // Nils Agnesson - case 15719: // Andreas Bjärnemalm - case 1185: // Jonatan Kindh - case 7838: // Jörgen Lindell - case 16761: // Mikael Holm - case 14843: // Staffan Jonsson - case 71888: // Henrik Brändén - { - isPresidency = true; - break; - } - default: - { - break; - } - } - - this.PersonSubmitter.Enabled = isPresidency; - - this.TextTitle.Focus(); - } - } - - protected void ButtonAddMotion_Click(object sender, EventArgs e) - { - if (!Page.IsValid) - { - this.LabelMotionSaved.Text = string.Empty; - return; // Do nothing if validators fail the page - } - - Motion newMotion = Motion.Create(_meeting, this.PersonSubmitter.SelectedPerson, CurrentUser, - this.TextTitle.Text, this.TextMotionText.Text, this.TextDecisionPoints.Text); - - this.LabelMotionSaved.Text = String.Format(Resources.Pages.Governance.AddMotion_MotionSubmittedAs, - newMotion.SequenceNumber); - - this.TextDecisionPoints.Text = string.Empty; - this.TextMotionText.Text = string.Empty; - this.TextTitle.Text = string.Empty; - - if (this.PersonSubmitter.Enabled) - { - this.PersonSubmitter.SelectedPerson = null; - } - - this.TextTitle.Focus(); - } - - protected void ValidatorSubmitterRequired_Validate(object source, ServerValidateEventArgs args) - { - if (this.PersonSubmitter.SelectedPerson == null) - { - args.IsValid = false; - } - else - { - args.IsValid = true; - } - } - } -} \ No newline at end of file diff --git a/Site5/Pages/v5/Governance/AddMotionAmendment.aspx b/Site5/Pages/v5/Governance/AddMotionAmendment.aspx deleted file mode 100644 index 0343eefb..00000000 --- a/Site5/Pages/v5/Governance/AddMotionAmendment.aspx +++ /dev/null @@ -1,70 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="AddMotionAmendment.aspx.cs" Inherits="Swarmops.Pages.Governance.AddMotionAmendment" %> -<%@ Register src="~/Controls/v5/Swarm/ComboPersonObsolete.ascx" tagname="ComboPerson" tagprefix="act5" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Site5/Pages/v5/Governance/AddMotionAmendment.aspx.cs b/Site5/Pages/v5/Governance/AddMotionAmendment.aspx.cs deleted file mode 100644 index 0f9bddde..00000000 --- a/Site5/Pages/v5/Governance/AddMotionAmendment.aspx.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Swarmops.Logic.Governance; - -namespace Swarmops.Pages.Governance -{ - public partial class AddMotionAmendment : PageV5Base - { - private Motion _motion; - - protected void Page_Load(object sender, EventArgs e) - { - string motionIdString = Request.QueryString["MotionId"]; - int motionId = Int32.Parse(motionIdString); - _motion = Motion.FromIdentity(motionId); - - // Stylize - - this.PageIcon = "iconshock-motion-amendment-add"; - this.TextTitle.Style[HtmlTextWriterStyle.Width] = "300px"; - this.PersonSubmitter.Width = 304; // !? - this.TextAmendmentText.Style[HtmlTextWriterStyle.Width] = "300px"; - this.TextDecisionPoint.Style[HtmlTextWriterStyle.Width] = "300px"; - this.TextAmendmentText.Style[HtmlTextWriterStyle.Height] = "200px"; - - // Localize - - this.PageTitle = Resources.Pages.Governance.AddMotionAmendment_PageTitle; - - this.LabelMotionName.Text = _motion.Title; - this.LabelSubmittingAmendmentInfo.Text = Resources.Pages.Governance.AddMotionAmendment_SubmittingAmendmentInfo; - this.LabelTitle.Text = Resources.Pages.Governance.AddMotionAmendment_Title; - this.LabelSubmitter.Text = Resources.Pages.Governance.AddMotionAmendment_Submitter; - this.LabelText.Text = Resources.Pages.Governance.AddMotionAmendment_Text; - this.LabelDecision.Text = Resources.Pages.Governance.AddMotionAmendment_Decision; - - this.LabelSidebarInfo.Text = Resources.Global.Sidebar_Information; - this.LabelSidebarActions.Text = Resources.Global.Sidebar_Actions; - this.LabelSidebarTodo.Text = Resources.Global.Sidebar_Todo; - this.LabelActionItemsHere.Text = Resources.Global.Sidebar_Todo_Placeholder; - - this.ButtonAddMotionAmendment.Text = Resources.Pages.Governance.AddMotionAmendment_SubmitAmendment; - - this.LabelActionListMotions.Text = Resources.Pages.Governance.ListMotions_PageTitle; - - if (!Page.IsPostBack) - { - this.PersonSubmitter.SelectedPerson = CurrentUser; - - // HACK: Hardcode the presidency of this meeting - - bool isPresidency = false; - - switch (CurrentUser.Identity) - { - case 1681: // Nils Agnesson - case 15719: // Andreas Bjärnemalm - case 1185: // Jonatan Kindh - case 7838: // Jörgen Lindell - case 16761: // Mikael Holm - case 14843: // Staffan Jonsson - case 71888: // Henrik Brändén - { - isPresidency = true; - break; - } - default: - { - break; - } - } - - this.PersonSubmitter.Enabled = isPresidency; - - this.TextTitle.Focus(); - } - } - - protected void ValidatorSubmitterRequired_Validate(object source, ServerValidateEventArgs args) - { - if (this.PersonSubmitter.SelectedPerson == null) - { - args.IsValid = false; - } - else - { - args.IsValid = true; - } - } - - protected void ButtonAddAmendment_Click(object sender, EventArgs e) - { - if (!Page.IsValid) - { - this.LabelAmendmentSaved.Text = string.Empty; - return; // Do nothing if validators fail the page - } - - MotionAmendment newAmendment = MotionAmendment.Create(_motion, this.TextTitle.Text, this.TextAmendmentText.Text, - this.TextDecisionPoint.Text, - this.PersonSubmitter.SelectedPerson, this.CurrentUser); - - this.LabelAmendmentSaved.Text = String.Format(Resources.Pages.Governance.AddMotionAmendment_AmendmentSubmittedAs, - _motion.SequenceNumber, (char) ((int)('A') + newAmendment.SequenceNumber - 1)); - - this.TextDecisionPoint.Text = string.Empty; - this.TextAmendmentText.Text = string.Empty; - this.TextTitle.Text = string.Empty; - - if (this.PersonSubmitter.Enabled) - { - this.PersonSubmitter.SelectedPerson = null; - } - - this.TextTitle.Focus(); - } - } -} \ No newline at end of file diff --git a/Site5/Pages/v5/Governance/ListMotions.aspx b/Site5/Pages/v5/Governance/ListMotions.aspx deleted file mode 100644 index c28a3079..00000000 --- a/Site5/Pages/v5/Governance/ListMotions.aspx +++ /dev/null @@ -1,68 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="ListMotions.aspx.cs" Inherits="Swarmops.Pages.Governance.ListMotions" %> - - - - - - - - - - - - - - - - - - - - - - – - - - - - – - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Site5/Pages/v5/Governance/ListMotions.aspx.cs b/Site5/Pages/v5/Governance/ListMotions.aspx.cs deleted file mode 100644 index c05b6b98..00000000 --- a/Site5/Pages/v5/Governance/ListMotions.aspx.cs +++ /dev/null @@ -1,213 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Swarmops.Logic.Governance; -using Telerik.Web.UI; - -namespace Swarmops.Pages.Governance -{ - public partial class ListMotions : PageV5Base - { - private Meeting _meeting = Meeting.FromIdentity(1); - private Dictionary _amendmentLookup; - - public ListMotions() - { - } - - protected void Page_Load(object sender, EventArgs e) - { - this.PageTitle = Resources.Pages.Governance.ListMotions_PageTitle; - this.PageIcon = "iconshock-motions"; - - this.LabelActionAddMotion.Text = Resources.Pages.Governance.AddMotion_PageTitle; - this.LabelActionVote.Text = Resources.Pages.Governance.Vote_PageTitle; - - Localize(); - - if (!this.IsPostBack) - { - PopulateGrid(); - this.GridMotions.DataBind(); - } - - ((Swarmops.MasterV5) Master).LanguageChanged += new EventHandler(Master_LanguageChanged); - - } - - private void Master_LanguageChanged(object sender, EventArgs e) - { - // Grid must be re-localized - - LocalizeGrid(); - PopulateGrid(); - this.GridMotions.DataBind(); - } - - - private void Localize() - { - this.LabelSidebarInfo.Text = Resources.Global.Sidebar_Information; - this.LabelSidebarActions.Text = Resources.Global.Sidebar_Actions; - this.LabelSidebarTodo.Text = Resources.Global.Sidebar_Todo; - this.LabelActionItemsHere.Text = Resources.Global.Sidebar_Todo_Placeholder; - - this.LabelSidebarLookingAt.Text = Resources.Pages.Governance.ListMotions_Sidebar_Info; - this.LabelMeetingName.Text = _meeting.Name; - this.LabelChangeMeeting.Text = Resources.Global.Global_Change; - - LocalizeGrid(); - } - - - private void LocalizeGrid() - { - TreeListColumnsCollection columns = this.GridMotions.Columns; - - foreach (TreeListColumn column in columns) - { - column.HeaderText = GetGlobalResourceObject("Pages.Governance", column.UniqueName).ToString(); - } - } - - private void PopulateGrid() - { - Motions motions = Motions.ForMeeting(_meeting); - MotionListRows rows = new MotionListRows(); - - MotionAmendments amendments = MotionAmendments.ForMeeting(_meeting); - - _amendmentLookup = new Dictionary(); - - foreach (Motion motion in motions) - { - MotionListRow newRow = new MotionListRow(motion.Identity, 0, motion.SequenceNumber.ToString(), motion.Title, - 0, false, false); - rows.Add(newRow); - } - - foreach (MotionAmendment amendment in amendments) - { - if (!_amendmentLookup.ContainsKey(amendment.MotionId)) - { - _amendmentLookup[amendment.MotionId] = new MotionAmendments(); - } - - _amendmentLookup[amendment.MotionId].Add(amendment); - - MotionListRow newRow = new MotionListRow(-amendment.Identity, amendment.MotionId, amendment.Designation, amendment.Title, 0, false, amendment.Carried); - - rows.Add(newRow); - } - - // TODO: Sort rows by identity - - this.GridMotions.DataSource = rows; - - // TODO: Store in session var to enable paging - } - - - protected void GridMotions_ItemCreated(object sender, TreeListItemCreatedEventArgs e) - { - MotionListRow row = null; - - if (!(e.Item is TreeListDataItem)) - { - return; - } - - row = ((TreeListDataItem) e.Item).DataItem as MotionListRow; - - if (row == null) - { - return; - } - - Literal literalAmendments = (Literal)e.Item.FindControl("LiteralAmendments"); - Literal literalTitle = (Literal)e.Item.FindControl("LiteralTitle"); - - if (row.Identity > 0) - { - int amendmentCount = 0; - - if (_amendmentLookup.ContainsKey(row.Identity)) - { - amendmentCount = _amendmentLookup[row.Identity].Count; - } - - literalAmendments.Text = String.Format("{0} ({2})", - amendmentCount, row.Identity, - Resources.Pages.Governance.ListMotions_SubmitAmendment); - - literalTitle.Text = String.Format("{1}", row.Identity, - HttpUtility.HtmlEncode(row.Title)); - } - else - { - literalAmendments.Text = string.Empty; - literalTitle.Text = HttpUtility.HtmlEncode(row.Title); - } - - // 0 (">Submit...) - // "><%# Eval("Title") %> - - } - - - public class MotionListRow - { - public MotionListRow (int identity, int parentIdentity, string designation, string title, int amendmentCount, bool amended, bool carried) - { - this.identity = identity; - this.parentIdentity = parentIdentity; - this.designation = designation; - this.title = title; - this.amendmentCount = amendmentCount; - this.amended = amended; - this.carried = carried; - } - - private int identity; - private int parentIdentity; - private string designation; - private string title; - private int amendmentCount; - private bool amended; - private bool carried; - - public int ParentIdentity - { - get { return this.parentIdentity; } - } - - public int Identity - { - get { return this.identity; } - } - - public string Designation - { - get { return this.designation; } - } - - public string Title - { - get { return this.title; } - } - } - - public class MotionListRows: List - { - // empty class; we just want the name - } - - protected void GridMotions_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e) - { - LocalizeGrid(); - PopulateGrid(); // read this from session var instead, later - } - } -} \ No newline at end of file diff --git a/Site5/Pages/v5/Governance/ViewMotion.aspx b/Site5/Pages/v5/Governance/ViewMotion.aspx deleted file mode 100644 index d8483d4f..00000000 --- a/Site5/Pages/v5/Governance/ViewMotion.aspx +++ /dev/null @@ -1,79 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="ViewMotion.aspx.cs" Inherits="Swarmops.Pages.Governance.ViewMotion" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - <%=GetGlobalResourceObject("Pages.Governance", "ViewMotion_Amendment").ToString() %> #<%# Eval("Designation") %><%# Eval("Title") %> - - - - <%=GetGlobalResourceObject("Pages.Governance", "ViewMotion_AmendmentText").ToString() %><%# Eval("Text") %> - - - - <%=GetGlobalResourceObject("Pages.Governance", "ViewMotion_AmendmentProposedChange").ToString() %><%# Eval("DecisionPoint") %> - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Site5/Pages/v5/Governance/ViewMotion.aspx.cs b/Site5/Pages/v5/Governance/ViewMotion.aspx.cs deleted file mode 100644 index 8a07dcb4..00000000 --- a/Site5/Pages/v5/Governance/ViewMotion.aspx.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Swarmops.Logic.Governance; - -namespace Swarmops.Pages.Governance -{ - public partial class ViewMotion : PageV5Base - { - private Motion _motion; - private Meeting _meeting; - - protected void Page_Load(object sender, EventArgs e) - { - string motionIdString = Request.QueryString["MotionId"]; - int motionId = Int32.Parse(motionIdString); - _motion = Motion.FromIdentity(motionId); - _meeting = _motion.Meeting; - - // TODO: Authorize - - // TODO: Get # of posts in discussion thread - - int discussionPostCount = 0; - - // Localize - - this.PageTitle = Resources.Pages.Governance.ViewMotion_PageTitle; - this.PageIcon = "iconshock-motion"; - - this.LabelActionListMotions.Text = Resources.Pages.Governance.ListMotions_PageTitle; - - this.LabelDiscussLabel.Text = Resources.Pages.Governance.ViewMotion_Discuss; - this.LabelMotionDecisionsLabel.Text = Resources.Pages.Governance.ViewMotion_DecisionPoints; - this.LabelMotionDesignation.Text = String.Format(Resources.Pages.Governance.ViewMotion_MotionDesignation, _motion.SequenceNumber); - this.LabelMotionTextLabel.Text = Resources.Pages.Governance.ViewMotion_Text; - this.LabelViewingMotionInfo.Text = Resources.Pages.Governance.ViewMotion_ViewingMotionInfo; - - this.LabelSidebarInfo.Text = Resources.Global.Sidebar_Information; - this.LabelSidebarActions.Text = Resources.Global.Sidebar_Actions; - this.LabelSidebarTodo.Text = Resources.Global.Sidebar_Todo; - this.LabelActionItemsHere.Text = Resources.Global.Sidebar_Todo_Placeholder; - - - // Fill in fields - - this.LabelMeetingName.Text = _meeting.Name; - this.LabelMotionText.Text = _motion.Text; - this.LabelMotionTitle.Text = _motion.Title; - this.LinkDiscussion.Text = String.Format(Resources.Pages.Governance.ViewMotion_DiscussLink, discussionPostCount); - - // construct motion text field (a literal, we make it an OL field, need to take care to HTML encode text) - - string[] decisionPoints = _motion.DecisionPoints.Split('\r', '\n'); - - string literal = ""; - foreach (string decisionPoint in decisionPoints) - { - string proposedDecision = decisionPoint.Trim(); - - if (proposedDecision.Length > 0) - { - literal += "" + HttpUtility.HtmlEncode(proposedDecision) + ""; - } - } - literal += ""; - - this.LiteralMotionDecisions.Text = literal; - - MotionAmendments amendments = _motion.Amendments; - - this.RepeaterAmendments.DataSource = amendments; - this.RepeaterAmendments.DataBind(); - - if (amendments.Count > 1) - { - this.LabelAmendmentCount.Text = String.Format(Resources.Pages.Governance.ViewMotion_AmendmentCountTwoPlus, - amendments.Count); - } - else if (amendments.Count == 1) - { - this.LabelAmendmentCount.Text = Resources.Pages.Governance.ViewMotion_AmendmentCountOne; - } - else // zero - { - this.LabelAmendmentCount.Text = Resources.Pages.Governance.ViewMotion_AmendmentCountZero; - } - - this.LinkAddAmendment.NavigateUrl = "AddMotionAmendment.aspx?MotionId=" + _motion.Identity.ToString(); - this.LinkAddAmendment.Text = Resources.Pages.Governance.ViewMotion_AddAmendment; - } - } -} \ No newline at end of file diff --git a/Site5/Pages/v5/Governance/Vote.aspx b/Site5/Pages/v5/Governance/Vote.aspx deleted file mode 100644 index b55880ba..00000000 --- a/Site5/Pages/v5/Governance/Vote.aspx +++ /dev/null @@ -1,60 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="Vote.aspx.cs" Inherits="Swarmops.Pages.Governance.Vote" %> - - - - - - -SIMULERAT VÅRMÖTE 2011 - - - - - - - - -Öppnar 2011-04-25 - - - - - - - -Styrelsens sammankallandeStyrelsen t.o.m. 2013Styrelsen t.o.m. 2012 (fyllnadsval)Mötespresidium -Öppnar 2011-05-03Öppnar 2011-05-03Öppnar 2011-05-03Öppnar 2011-05-03 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Site5/Pages/v5/Governance/Vote.aspx.cs b/Site5/Pages/v5/Governance/Vote.aspx.cs deleted file mode 100644 index 24cb02d3..00000000 --- a/Site5/Pages/v5/Governance/Vote.aspx.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Swarmops.Logic.Governance; - -namespace Swarmops.Pages.Governance -{ - - public partial class Vote : PageV5Base - { - protected void Page_Load(object sender, EventArgs e) - { - int motionCount = Motions.ForMeeting(Meeting.FromIdentity(1)).Count; - int amendmentCount = MotionAmendments.ForMeeting(Meeting.FromIdentity(1)).Count; - - this.PageTitle = Resources.Pages.Governance.Vote_PageTitle; - this.PageIcon = "iconshock-vote"; - - this.LabelSidebarInfo.Text = Resources.Global.Sidebar_Information; - this.LabelSidebarActions.Text = Resources.Global.Sidebar_Actions; - this.LabelSidebarTodo.Text = Resources.Global.Sidebar_Todo; - this.LabelActionItemsHere.Text = Resources.Global.Sidebar_Todo_Placeholder; - - this.LabelActionListMotions.Text = Resources.Pages.Governance.ListMotions_PageTitle; - this.LabelVotingInfo.Text = String.Format(Resources.Pages.Governance.Vote_Info, CurrentOrganization.Name); - - this.LabelPointsOfOrderHeader.Text = Resources.Pages.Governance.Vote_PointsOfOrder; - this.LabelPointsOfOrderTemp.Text = Resources.Pages.Governance.Vote_PointsOfOrderTemp; - - this.LabelVoteAmendmentsLabel.Text = String.Format(Resources.Pages.Governance.Vote_VoteOnAmendments, - amendmentCount); - this.LabelVoteMotionsLabel.Text = String.Format(Resources.Pages.Governance.Vote_VoteOnMotions, motionCount); - - this.LabelCreateVotingList.Text = Resources.Pages.Governance.Vote_CreateVotingList; - this.LabelVoteHere.Text = Resources.Pages.Governance.Vote_VoteHere; - - this.LabelElectionsHeader.Text = Resources.Pages.Governance.Vote_MeetingElections; - this.LabelMotionsHeader.Text = Resources.Pages.Governance.Vote_Motions; - } - } -} \ No newline at end of file diff --git a/Site5/Pages/v5/Governance/VoteAmendments.aspx b/Site5/Pages/v5/Governance/VoteAmendments.aspx deleted file mode 100644 index fef2da1e..00000000 --- a/Site5/Pages/v5/Governance/VoteAmendments.aspx +++ /dev/null @@ -1,70 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" EnableEventValidation="false" AutoEventWireup="true" CodeFile="VoteAmendments.aspx.cs" Inherits="Swarmops.Pages.Governance.VoteAmendments" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Site5/Pages/v5/Governance/VoteAmendments.aspx.cs b/Site5/Pages/v5/Governance/VoteAmendments.aspx.cs deleted file mode 100644 index d8cfd6d8..00000000 --- a/Site5/Pages/v5/Governance/VoteAmendments.aspx.cs +++ /dev/null @@ -1,262 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Swarmops.Logic.Swarm; -using Swarmops.Logic.Governance; -using Telerik.Web.UI; - -namespace Swarmops.Pages.Governance -{ - public partial class VoteAmendments : PageV5Base - { - private Meeting _meeting; - private string _selectedRecommendation; - - protected void Page_Init (object sender, EventArgs e) - { - _selectedRecommendation = Request.Form["ctl00$PlaceHolderMain$DropRecommendations"]; - if (String.IsNullOrEmpty(_selectedRecommendation)) - { - _selectedRecommendation = "0"; - } - - /* - PopulateGrid(); - this.GridAmendmentsVote.DataBind();*/ - } - - protected void Page_Load(object sender, EventArgs e) - { - string motionIdString = Request.QueryString["MeetingId"]; - int meetingId = Int32.Parse(motionIdString); - _meeting = Meeting.FromIdentity(meetingId); - - // TODO: Authorize - - // Localize - - this.PageTitle = Resources.Pages.Governance.VoteAmendments_PageTitle; - this.PageIcon = "iconshock-motion-amendments-vote"; - - this.LabelActionListMotions.Text = Resources.Pages.Governance.ListMotions_PageTitle; - - // Fill in fields - - LocalizeGrid(); - Localize(); - - if (!Page.IsPostBack) - { - PopulateGrid(); - PopulateRecommendations(); - } - - this.DropRecommendations.Style[HtmlTextWriterStyle.Position] = "relative"; - this.DropRecommendations.Style[HtmlTextWriterStyle.Top] = "3px"; - } - - private void LocalizeGrid() - { - TreeListColumnsCollection columns = this.GridAmendmentsVote.Columns; - - foreach (TreeListColumn column in columns) - { - column.HeaderText = GetGlobalResourceObject("Pages.Governance", column.UniqueName).ToString(); - } - } - - private void Localize() - { - this.LabelActionListMotions.Text = Resources.Pages.Governance.ListMotions_PageTitle; - this.LabelActionItemsHere.Text = Resources.Global.Sidebar_Todo_Placeholder; - this.LabelAmendmentsForMeeting.Text = _meeting.Name; - this.LabelSidebarInfo.Text = Resources.Global.Sidebar_Information; - this.LabelSidebarActions.Text = Resources.Global.Sidebar_Actions; - this.LabelSidebarTodo.Text = Resources.Global.Sidebar_Todo; - this.ButtonSaveVote.Text = Resources.Pages.Governance.VoteAmendments_SaveVote_Temp; - - this.LabelInfo.Text = Resources.Pages.Governance.VoteAmendments_Info; - } - - private void PopulateRecommendations() - { - this.DropRecommendations.Items.Clear(); - this.DropRecommendations.Items.Add(new ListItem(Resources.Pages.Governance.VoteAmendments_SelectRecommendation, "0")); - this.DropRecommendations.Items.Add(new ListItem(Resources.Pages.Governance.VoteAmendments_BoardRecommendation, "-1")); - this.DropRecommendations.Items.Add(new ListItem("DinLista - " + CurrentUser.Canonical, "3")); - this.DropRecommendations.Items.Add(new ListItem("TestList - Rick Falkvinge (#1)", "1")); - } - - - private void PopulateGrid() - { - // Use lazy method. This can be optimized plenty. - - List items = new List(); - Motions motions = Motions.ForMeeting(_meeting); - - foreach (Motion motion in motions) - { - items.Add(new GridRowItem(String.Format(Resources.Pages.Governance.ViewMotion_MotionDesignation, motion.SequenceNumber), motion.Title, motion.Submitter, -motion.Identity, 0)); - items.Add(new GridRowItem(Resources.Pages.Governance.VoteAmendments_Grid_Text, motion.Text, null, -motion.Identity + 210000, -motion.Identity)); - items.Add(new GridRowItem(Resources.Pages.Governance.VoteAmendments_Grid_Decision, motion.DecisionPoints, null, -motion.Identity + 220000, -motion.Identity)); - - MotionAmendments amendments = MotionAmendments.ForMotion(motion); - - foreach (MotionAmendment amendment in amendments) - { - items.Add(new GridRowItem("#" + amendment.Designation, amendment.Title, amendment.Submitter, amendment.Identity, 0)); - items.Add(new GridRowItem(Resources.Pages.Governance.VoteAmendments_Grid_Rationale, amendment.Text, null, - amendment.Identity + 100000, amendment.Identity)); - items.Add(new GridRowItem(Resources.Pages.Governance.VoteAmendments_Grid_Change, - amendment.DecisionPoint, null, amendment.Identity + 200000, amendment.Identity)); - } - } - - this.GridAmendmentsVote.DataSource = items; - } - - - public class GridRowItem - { - public GridRowItem(string designation, string text, Person submitter, int identity, int parentIdentity) - { - this.TextField = text; - this.DesignationField = designation; - this.Submitter = submitter; - this.IdentityField = identity; - this.ParentIdentityField = parentIdentity; - } - - public string Title; - public string TextField; - public string DesignationField; - public Person Submitter; - public int IdentityField; - public int ParentIdentityField; - - public int Identity - { - get { return this.IdentityField; } - } - - public int ParentIdentity - { - get { return this.ParentIdentityField; } - } - - public string Designation - { - get { return this.DesignationField;} - } - - public string Text - { - get { return this.TextField; } - } - } - - protected void GridAmendments_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e) - { - PopulateGrid(); - } - - protected void GridAmendmentsVote_ItemCreated(object sender, TreeListItemCreatedEventArgs e) - { - GridRowItem row = null; - - if (!(e.Item is TreeListDataItem)) - { - return; - } - - row = ((TreeListDataItem)e.Item).DataItem as GridRowItem; - - if (row == null) - { - return; - } - - RadioButton radioYes = (RadioButton)e.Item.FindControl("RadioYes"); - RadioButton radioNo = (RadioButton)e.Item.FindControl("RadioNo"); - RadioButton radioAbstain = (RadioButton)e.Item.FindControl("RadioAbstain"); - Label labelRecommendation = (Label)e.Item.FindControl("LabelRecommendation"); - - labelRecommendation.Style[HtmlTextWriterStyle.FontWeight] = "700"; - labelRecommendation.Style[HtmlTextWriterStyle.Color] = "#880"; - - bool showButtons = false; - - if (row.Identity > 0 && row.Identity < 100000) - { - showButtons = true; - - string recommendation = Resources.Pages.Governance.VoteAmendments_Recommend_Abstain; - - radioYes.GroupName = - radioNo.GroupName = - radioAbstain.GroupName = "Amendment" + row.Identity.ToString(); - - if (_selectedRecommendation != "0") - { - switch ((Convert.ToInt32(_selectedRecommendation) + row.Identity) % 3) - { - case 1: - recommendation = Resources.Pages.Governance.VoteAmendments_Recommend_Yes; - labelRecommendation.Style[HtmlTextWriterStyle.Color] = "#080"; - break; - case 2: - recommendation = Resources.Pages.Governance.VoteAmendments_Recommend_No; - labelRecommendation.Style[HtmlTextWriterStyle.Color] = "#800"; - break; - default: - break; - } - } - - labelRecommendation.Text = recommendation; - - // Repopulate the state directly from the form - - string previousState = null; - - foreach (string key in Request.Form.AllKeys) - { - if (key.EndsWith(radioYes.GroupName)) - { - previousState = Request.Form[key]; - } - } - - if (!String.IsNullOrEmpty(previousState)) - { - if (previousState == "RadioYes") - { - radioYes.Checked = true; - } - else if (previousState == "RadioNo") - { - radioNo.Checked = true; - } - else if (previousState == "RadioAbstain") - { - radioAbstain.Checked = true; - } - } - } - - radioYes.Visible = showButtons; - radioNo.Visible = showButtons; - radioAbstain.Visible = showButtons; - labelRecommendation.Visible = showButtons; - } - - protected void DropRecommendations_SelectedIndexChanged(object sender, EventArgs e) - { - PopulateGrid(); - this.GridAmendmentsVote.DataBind(); - } - } -} \ No newline at end of file diff --git a/Site5/Pages/v5/Init/Default.aspx b/Site5/Pages/v5/Init/Default.aspx index 4b786f57..53cebc3c 100644 --- a/Site5/Pages/v5/Init/Default.aspx +++ b/Site5/Pages/v5/Init/Default.aspx @@ -20,8 +20,6 @@ Swarmops - Initialize Installation - - @@ -42,7 +40,6 @@ - - - - - - @@ -341,130 +333,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -646,15 +514,6 @@ - - - - - -