Added some UX behavior

This commit is contained in:
Rick Falkvinge
2018-04-15 18:20:23 +02:00
parent 6729e5c774
commit 368e4a5f0c
2 changed files with 34 additions and 7 deletions
+20 -7
View File
@@ -527,6 +527,15 @@
}
function onToggleChange(newValue, cookie) {
if (newValue) {
$(".DivEditAutomationControls").slideDown();
} else {
$(".DivEditAutomationControls").slideUp();
}
}
var currentYear = <%=DateTime.Today.Year %>;
var firstFiscalYear = <%=CurrentOrganization.FirstFiscalYear %>;
var ledgersClosedUntil = <%=CurrentOrganization.Parameters.FiscalBooksClosedUntilYear %>;
@@ -574,6 +583,10 @@
font-weight:500;
}
.DivEditAutomaticRetrievalCredentials, .DivEditAutomationProfileCustom, .DivEditAutomationControls, .DivEditForexControls {
display: none;
}
</style>
</asp:Content>
@@ -617,15 +630,15 @@
<div class="DivEditForexControls"><Swarmops5:TextCurrency ID="CurrencyInitialBalanceForex" runat="server" /></div></div>
<div class="DivEditAssetControls">
<div class="stacked-input-control"></div><!-- space for headline -->
<Swarmops5:AjaxToggleSlider ID="ToggleAssetAutomation" runat="server"/>
<Swarmops5:AjaxToggleSlider ID="ToggleAssetAutomation" OnChange="onToggleChange" Cookie="Automation" runat="server"/>
<div class="DivEditAutomationControls">
<Swarmops5:AjaxDropDown ID="DropAccountAutomationProfile" runat="server"/>
<div class="DivAutomationProfileCustom">
<div class="DivEditAutomationProfileCustom">
<Swarmops5:AjaxTextBox ID="TextCustomAutomationProfile" runat="server"/>
</div>
<div class="DivAutomaticRetrieval">
<div class="DivEditAutomaticRetrieval">
<Swarmops5:AjaxToggleSlider ID="ToggleAutoRetrieval" runat="server"/>
<div class="DivAutomaticRetrievalCredentials">
<div class="DivEditAutomaticRetrievalCredentials">
<Swarmops5:AjaxTextBox ID="TextRetrievalLogin" runat="server"/>
<Swarmops5:AjaxTextBox ID="TextRetrievalPassword" runat="server"/>
</div>
@@ -650,12 +663,12 @@
Enable account automation<br/>
<div class="DivEditAutomationControls">
<asp:Label runat="server" ID="LabelFileUploadProfile"/><br/>
<div class="DivAutomationProfileCustom">
<div class="DivEditAutomationProfileCustom">
Custom Profile XML<br/>
</div>
<div class="DivAutomaticRetrieval">
<div class="DivEditAutomaticRetrieval">
Automatic Retrieval<br />
<div class="DivAutomaticRetrievalCredentials">
<div class="DivEditAutomaticRetrievalCredentials">
Autoretrieval Username<br/>
Autoretrieval Password<br />
</div>
+14
View File
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.Web;
using System.Web.Services;
using System.Web.UI.WebControls;
using Resources;
using Swarmops.Common.Enums;
using Swarmops.Logic.Financial;
@@ -94,6 +95,15 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
this.LabelSidebarOptions.Text = Resources.Global.Sidebar_Options;
this.LabelOptionsShowInactive.Text = String.Format(Resources.Pages.Ledgers.AccountPlan_Options_ShowInactive, inactiveCount);
this.DropAccountAutomationProfile.Items.Add(new ListItem(Resources.Global.Global_SelectOne, "0"));
// Hardcoded automation profiles for the time being
this.DropAccountAutomationProfile.Items.Add(new ListItem("[CZ CZK] Fio CSV", "3"));
this.DropAccountAutomationProfile.Items.Add(new ListItem("[DE EUR] Postbank CSV", "2"));
this.DropAccountAutomationProfile.Items.Add(new ListItem("[SE SEK] SEB CSV", "1"));
}
PageAccessRequired = new Access (CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Write);
DbVersionRequired = 2; // Account reparenting
@@ -512,6 +522,10 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
}
}
[WebMethod]
public static bool ToggleSwitch ()
[WebMethod]
public static bool SetAccountSwitch (int accountId, string switchName, bool switchValue)
{