Committing to test styling on live system

This commit is contained in:
Rick Falkvinge
2012-01-13 23:59:20 +00:00
parent bc9e8cc3cd
commit 935f455500
9 changed files with 178 additions and 1 deletions
@@ -117,6 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="SetRootBudgets_PageTitle" xml:space="preserve">
<value>Set Root Level Budgets</value>
<comment>Displayed above main content</comment>
</data>
<data name="UploadBankFiles_BankScreenshot" xml:space="preserve">
<value>Bank Screenshot</value>
<comment>Displayed as header above modally zoomed screenshot</comment>
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

+1 -1
View File
@@ -119,7 +119,7 @@
<telerik:RadMenuItem runat="server" IsSeparator="true" UserLevel="3" />
<telerik:RadMenuItem runat="server" Text="XYZ Audit Ledgers" Permission="EconomyDetail:Read" UserLevel="3" GlobalResourceKey="Menu5_Ledgers_AuditLedgers" />
<telerik:RadMenuItem runat="server" Text="XYZ Account Plan" Permission="Economy:Read" UserLevel="3" GlobalResourceKey="Menu5_Ledgers_AccountPlan" />
<telerik:RadMenuItem runat="server" Text="XYZ Set Budget" Permission="Economy:Read" UserLevel="3" GlobalResourceKey="Menu5_Ledgers_SetBudgets" />
<telerik:RadMenuItem runat="server" Text="XYZ Set Budget" NavigateUrl="~/Pages/v5/Ledgers/SetRootBudgets.aspx" ImageUrl="~/Images/PageIcons/iconshock-moneybag-16px.png" Permission="Financial:Write" UserLevel="3" GlobalResourceKey="Menu5_Ledgers_SetBudgets" />
<telerik:RadMenuItem runat="server" IsSeparator="true" UserLevel="3" />
<telerik:RadMenuItem runat="server" Text="XYZ Upload Bank Files" NavigateUrl="~/Pages/v5/Ledgers/UploadBankFiles.aspx" ImageUrl="~/Images/PageIcons/iconshock-bank-16px.png" Permission="Economy:Write" UserLevel="3" GlobalResourceKey="Menu5_Ledgers_UploadBankFiles" />
<telerik:RadMenuItem runat="server" IsSeparator="true" UserLevel="3" />
@@ -0,0 +1,57 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="SetRootBudgets.aspx.cs" Inherits="Pages_v5_Ledgers_SetRootBudgets" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHead" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" Runat="Server">
<h2><asp:Label ID="LabelRootBudgetHeader" Text="Root Budgets For Org [LOC]" runat="server" /></h2>
<div class="entrylabels" style="margin-right:30px;width:200px">
<strong><asp:Label ID="LabelYear" Text="Year [LOC]" runat="server" /></strong><br/>
<asp:Repeater ID="RepeaterAccountNames" runat="server" OnItemDataBound="RepeaterAccountNames_ItemDataBound" ><ItemTemplate><asp:Label ID="LabelAccountName" runat="server" Text="Unset Account Name" /> <em>(<asp:Label ID="LabelAccountType" runat="server" Text="Type [LOC]" />)</em><br /></ItemTemplate></asp:Repeater>
</div>
<div class="entryfields">
<strong><asp:DropDownList ID="DropYears" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropYears_SelectedIndexChanged" /></strong>&nbsp;<br/>
<asp:Repeater ID="RepeaterAccountBudgets" OnItemDataBound="RepeaterAccountBudgets_ItemDataBound" runat="server"><ItemTemplate><asp:TextBox ID="TextBudget" runat="server" Text="Not set" />&nbsp;<br/></ItemTemplate></asp:Repeater>
</div>
<div style="clear:both"></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderSide" Runat="Server">
<h2 class="blue"><asp:Label ID="LabelSidebarInfo" runat="server" /><span class="arrow"></span></h2>
<div class="box">
<div class="content">
<asp:Label ID="LabelDashboardInfo" Text="You have not localized the dashboard information box." runat="server" /></a>
</div>
</div>
<h2 class="blue"><asp:Label ID="LabelSidebarActions" runat="server" /><span class="arrow"></span></h2>
<div class="box">
<div class="content"><!--
<div class="link-row-encaps" onclick="document.location='/Pages/v5/Governance/Vote.aspx';" >
<div class="link-row-icon" style="background-image:url('/Images/PageIcons/iconshock-vote-16px.png')"></div>
<asp:Label ID="LabelActionVote" runat="server" />
</div>
<div class="link-row-encaps" onclick="document.location='/Pages/v5/Governance/ListMotions.aspx';" >
<div class="link-row-icon" style="background-image:url('/Images/PageIcons/iconshock-motions-16px.png')"></div>
<asp:Label ID="LabelActionListMotions" runat="server" />
</div>-->
</div>
</div>
<h2 class="orange"><asp:Label ID="LabelSidebarTodo" runat="server" /><span class="arrow"></span></h2>
<div class="box">
<div class="content">
<asp:Label ID="LabelActionItemsHere" runat="server" />
</div>
</div>
</asp:Content>
@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Activizr.Basic.Enums;
using Activizr.Logic.Financial;
using Activizr.Logic.Security;
public partial class Pages_v5_Ledgers_SetRootBudgets : PageV5Base
{
protected void Page_Load(object sender, EventArgs e)
{
this.PageAccessRequired = new Access(_currentOrganization, AccessAspect.Bookkeeping, AccessType.Write);
this.PageIcon = "iconshock-moneybag";
this.PageTitle = Resources.Pages.Ledgers.SetRootBudgets_PageTitle;
if (!Page.IsPostBack)
{
FinancialAccounts accounts = GetRootLevelAccounts();
int currentYear = DateTime.Today.Year;
_year = currentYear;
do
{
this.DropYears.Items.Add(new ListItem(currentYear.ToString()));
currentYear--;
} while (accounts[0].GetBudgetCents(currentYear) > 0);
this.DropYears.SelectedIndex = 0;
this.RepeaterAccountNames.DataSource = accounts;
this.RepeaterAccountNames.DataBind();
this.RepeaterAccountBudgets.DataSource = accounts;
this.RepeaterAccountBudgets.DataBind();
}
else
{
_year = Int32.Parse(DropYears.SelectedItem.Text);
}
this.DropYears.Style[HtmlTextWriterStyle.FontWeight] = "bold";
}
private int _year;
protected void RepeaterAccountNames_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
RepeaterItem item = e.Item;
if (item.DataItem == null)
{
return;
}
FinancialAccount account = (FinancialAccount) item.DataItem;
Label labelAccountName = (Label) e.Item.FindControl("LabelAccountName");
Label labelAccountType = (Label) e.Item.FindControl("LabelAccountType");
labelAccountName.Text = account.Name;
// TODO: Add Type Too
labelAccountType.Text = account.AccountType.ToString();
}
protected void RepeaterAccountBudgets_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
RepeaterItem item = e.Item;
if (item.DataItem == null)
{
return;
}
FinancialAccount account = (FinancialAccount)item.DataItem;
TextBox textBudget = (TextBox) e.Item.FindControl("TextBudget");
textBudget.Text = String.Format("{0:N0}", account.GetBudgetCents(_year)/100);
textBudget.Style[HtmlTextWriterStyle.TextAlign] = "right";
textBudget.Style[HtmlTextWriterStyle.Width] = "150px";
}
protected void DropYears_SelectedIndexChanged(object sender, EventArgs e)
{
FinancialAccounts accounts = GetRootLevelAccounts();
this.RepeaterAccountBudgets.DataSource = accounts;
this.RepeaterAccountBudgets.DataBind();
}
private FinancialAccounts GetRootLevelAccounts()
{
FinancialAccounts allAccounts = FinancialAccounts.ForOrganization(_currentOrganization, FinancialAccountType.Result);
// Select root accounts
FinancialAccounts accounts = new FinancialAccounts();
foreach (FinancialAccount account in allAccounts)
{
if (account.ParentFinancialAccountId == 0)
{
accounts.Add(account);
}
}
return accounts;
}
}