Changed loc convention (this removes a JS warning)

This commit is contained in:
Rick Falkvinge
2016-10-01 22:20:57 +02:00
parent aafdc3a294
commit 97d86f0d4e
9 changed files with 168 additions and 139 deletions
+54
View File
@@ -501,6 +501,15 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to Create.
/// </summary>
internal static string CreateInboundInvoice_ButtonCreate {
get {
return ResourceManager.GetString("CreateInboundInvoice_ButtonCreate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Description.
/// </summary>
@@ -609,6 +618,51 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to Please enter the amount of money (in {0}) the invoice requests..
/// </summary>
internal static string CreateInboundInvoice_ValidationError_Amount {
get {
return ResourceManager.GetString("CreateInboundInvoice_ValidationError_Amount", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please specify a budget to charge..
/// </summary>
internal static string CreateInboundInvoice_ValidationError_Budget {
get {
return ResourceManager.GetString("CreateInboundInvoice_ValidationError_Budget", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please upload one or more documents of the original invoice..
/// </summary>
internal static string CreateInboundInvoice_ValidationError_Documents {
get {
return ResourceManager.GetString("CreateInboundInvoice_ValidationError_Documents", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please select an option..
/// </summary>
internal static string CreateInboundInvoice_ValidationError_MissingTag {
get {
return ResourceManager.GetString("CreateInboundInvoice_ValidationError_MissingTag", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please describe what this purchase was..
/// </summary>
internal static string CreateInboundInvoice_ValidationError_Purpose {
get {
return ResourceManager.GetString("CreateInboundInvoice_ValidationError_Purpose", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This is a QR code for donations to {0}. Read it from your phone&apos;s bitcoin wallet to make a donation, or donate from your computer directly to [{1}] (that&apos;s a bitcoin address)..
/// </summary>
@@ -585,6 +585,25 @@
<data name="ValidateReceipts_ReceiptsValidated" xml:space="preserve">
<value>The receipts for Expense Claim #{0:N0} for {1} {2:N2} have been validated.</value>
</data>
<data name="CreateInboundInvoice_ButtonCreate" xml:space="preserve">
<value>Create</value>
<comment>Could also be "file" (as verb, about the invoice) or equivalent</comment>
</data>
<data name="CreateInboundInvoice_ValidationError_Amount" xml:space="preserve">
<value>Please enter the amount of money (in {0}) the invoice requests.</value>
</data>
<data name="CreateInboundInvoice_ValidationError_Budget" xml:space="preserve">
<value>Please specify a budget to charge.</value>
</data>
<data name="CreateInboundInvoice_ValidationError_Documents" xml:space="preserve">
<value>Please upload one or more documents of the original invoice.</value>
</data>
<data name="CreateInboundInvoice_ValidationError_MissingTag" xml:space="preserve">
<value>Please select an option.</value>
</data>
<data name="CreateInboundInvoice_ValidationError_Purpose" xml:space="preserve">
<value>Please describe what this purchase was.</value>
</data>
<data name="FileExpenseClaim_ButtonRequest" xml:space="preserve">
<value>Request</value>
<comment>Could also be "file" (as verb) or equivalent</comment>
@@ -35,23 +35,23 @@
function validateFields() {
var isValid = true;
isValid = validateTextField('#<%=this.TextAccount.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorBankAccount" />") && isValid;
isValid = validateTextField('#<%=this.TextAccount.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ValidationError_BankAccount %>')) && isValid;
if ($('#<%=this.ComboBudgets.ClientID %>_DropBudgets').combotree('tree').tree('getSelected') == null) {
isValid = false;
$('#<%=this.ComboBudgets.ClientID %>_SpanBudgets').addClass("entryError");
alertify.error("<asp:Literal runat="server" ID="LiteralErrorBudget" />");
alertify.error(SwarmopsJS.unescape('<%= this.Localized_ValidationError_Budget %>'));
}
<asp:Repeater ID="RepeaterErrorCheckTags" runat="server"><ItemTemplate>
if ($('#DropTags<%# Eval("TagSetId") %>').combotree('tree').tree('getSelected') == null) {
isValid = false;
$('#SpanDropTags<%# Eval("TagSetId") %>').addClass("entryError");
alertify.error('<%=Resources.Pages.Financial.FileExpenseClaim_ValidationError_MissingTag.Replace("'", "''") %>');
alertify.error(SwarmopsJS.unescape('<%=this.Localized_ValidationError_MissingTag %>'));
}
</ItemTemplate></asp:Repeater>
isValid = validateTextField('#<%=this.TextPurpose.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorPurpose" />") && isValid;
isValid = validateTextField('#<%=this.TextPurpose.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ValidationError_Purpose %>')) && isValid;
var jsonData = {};
jsonData.amount = $('#<%=this.CurrencyAmount.ClientID %>_Input').val();
@@ -67,7 +67,7 @@
if (msg.d != true) {
isValid = false;
$('#<%=CurrencyAmount.ClientID %>_Input').addClass("entryError");
alertify.error("<asp:Literal runat="server" ID="LiteralErrorAmount" />");
alertify.error(SwarmopsJS.unescape('<%= this.Localized_ValidationError_Amount %>'));
$('#<%=CurrencyAmount.ClientID %>_Input').focus();
}
}
@@ -84,7 +84,7 @@
if (msg.d != true) {
isValid = false;
$('#TextAmount').addClass("entryError");
alertify.error("<asp:Literal runat="server" ID="LiteralErrorDocuments" />");
alertify.error(SwarmopsJS.unescape('<%= this.Localized_ValidationError_Documents %>'));
}
}
});
@@ -104,7 +104,7 @@
}
var successMessage = unescape('<asp:Literal runat="server" ID="LiteralSuccess" />');
var successMessage = SwarmopsJS.unescape(<%= this.Localized_ForGreatJustice %>);
</script>
</asp:Content>
@@ -122,12 +122,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
this.LabelReference.Text = Resources.Pages.Financial.CreateInboundInvoice_Reference;
this.LabelAccount.Text = Resources.Pages.Financial.CreateInboundInvoice_SupplierAccount;
this.LiteralErrorAmount.Text = Resources.Pages.Financial.FileExpenseClaim_ValidationError_Amount;
// TODO: Validation errors
this.LiteralErrorPurpose.Text = Resources.Pages.Financial.FileExpenseClaim_ValidationError_Purpose;
this.LiteralErrorBudget.Text = Resources.Pages.Financial.RequestCashAdvance_ValidationError_Budget;
this.LiteralErrorBankAccount.Text = Resources.Pages.Financial.CreateInboundInvoice_ValidationError_Account;
this.LiteralErrorDocuments.Text = Resources.Pages.Financial.FileExpenseClaim_ValidationError_Documents;
this.ButtonCreate.Text = Resources.Pages.Financial.CreateInboundInvoice_ButtonCreate;
}
@@ -186,9 +181,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
// Display success message
this.LiteralSuccess.Text = HttpUtility.UrlEncode (
String.Format (Resources.Pages.Financial.CreateInboundInvoice_SuccessMessage,
invoice.Identity)).Replace ("+", "%20");
invoiceId = invoice.Identity; // a property returns the localized string
// Reset all fields for next invoice
@@ -206,10 +199,55 @@ namespace Swarmops.Frontend.Pages.v5.Financial
}
private int invoiceId = 0;
protected class TagSetDataSourceItem
{
public int TagSetId { get; set; }
public string TagSetLocalizedName { get; set; }
}
// ReSharper disable InconsistentNaming
public string Localized_ForGreatJustice
{
get
{
return
JavascriptEscape (String.Format (Resources.Pages.Financial.CreateInboundInvoice_SuccessMessage,
invoiceId));
}
}
public string Localized_ValidationError_MissingTag
{
get { return JavascriptEscape(Resources.Pages.Financial.CreateInboundInvoice_ValidationError_MissingTag); }
}
public string Localized_ValidationError_Account
{
get { return JavascriptEscape(Resources.Pages.Financial.CreateInboundInvoice_ValidationError_Account); }
}
public string Localized_ValidationError_Purpose
{
get { return JavascriptEscape(Resources.Pages.Financial.CreateInboundInvoice_ValidationError_Purpose); }
}
public string Localized_ValidationError_Budget
{
get { return JavascriptEscape(Resources.Pages.Financial.CreateInboundInvoice_ValidationError_Budget); }
}
public string Localized_ValidationError_Amount
{
get { return JavascriptEscape(Resources.Pages.Financial.CreateInboundInvoice_ValidationError_Amount); }
}
public string Localized_ValidationError_Documents
{
get { return JavascriptEscape(Resources.Pages.Financial.CreateInboundInvoice_ValidationError_Documents); }
}
}
}
@@ -21,24 +21,6 @@ namespace Swarmops.Frontend.Pages.v5.Financial {
/// </remarks>
protected global::System.Web.UI.WebControls.Repeater RepeaterTagDropScript;
/// <summary>
/// LiteralErrorBankAccount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorBankAccount;
/// <summary>
/// LiteralErrorBudget control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorBudget;
/// <summary>
/// RepeaterErrorCheckTags control.
/// </summary>
@@ -48,42 +30,6 @@ namespace Swarmops.Frontend.Pages.v5.Financial {
/// </remarks>
protected global::System.Web.UI.WebControls.Repeater RepeaterErrorCheckTags;
/// <summary>
/// LiteralErrorPurpose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorPurpose;
/// <summary>
/// LiteralErrorAmount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorAmount;
/// <summary>
/// LiteralErrorDocuments control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorDocuments;
/// <summary>
/// LiteralSuccess control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralSuccess;
/// <summary>
/// BoxTitle control.
/// </summary>
@@ -257,7 +257,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
public string Localized_ValidationError_Amount
{
get { return JavascriptEscape(Resources.Pages.Financial.FileExpenseClaim_ValidationError_Amount); }
get { return JavascriptEscape(String.Format(Resources.Pages.Financial.FileExpenseClaim_ValidationError_Amount, CurrentOrganization.Currency.DisplayCode)); }
}
public string Localized_ValidationError_Documents
@@ -9,16 +9,17 @@
function validateFields() {
var isValid = true;
isValid = validateTextField('#<%=this.TextAccount.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorBankAccount" />") && isValid;
isValid = validateTextField('#<%=this.TextClearing.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorBankClearing" />") && isValid;
isValid = validateTextField('#<%=this.TextBank.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorBankName" />") && isValid;
isValid = validateTextField('#<%=this.TextAccount.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ValidationError_BankAccount %>')) && isValid;
isValid = validateTextField('#<%=this.TextClearing.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ValidationError_BankClearing %>')) && isValid;
isValid = validateTextField('#<%=this.TextBank.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ValidationError_BankName %>')) && isValid;
if ($('#<%=this.ComboBudgets.ClientID %>_DropBudgets').combotree('tree').tree('getSelected') == null) {
isValid = false;
alertify.error("<asp:Literal runat="server" ID="LiteralErrorBudget" />");
$('#<%=this.ComboBudgets.ClientID %>_SpanBudgets').addClass("entryError");
alertify.error(SwarmopsJS.unescape('<%= this.Localized_ValidationError_Budget %>'));
}
isValid = validateTextField('#<%=this.TextPurpose.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorPurpose" />") && isValid;
isValid = validateTextField('#<%=this.TextPurpose.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ValidationError_Purpose %>')) && isValid;
var jsonData = {};
jsonData.amount = $('#<%=this.TextAmount.ClientID %>_Input').val();
@@ -33,7 +34,7 @@
success: function (msg) {
if (msg.d != true) {
isValid = false;
alertify.error("<asp:Literal runat="server" ID="LiteralErrorAmount" />");
alertify.error(SwarmopsJS.unescape('<%= this.Localized_ValidationError_Amount %>'));
$('#<%=this.TextAmount.ClientID %>_Input').addClass("entryError").focus();
}
}
@@ -48,14 +48,6 @@ namespace Swarmops.Frontend.Pages.v5.Financial
this.LabelBankName.Text = Resources.Pages.Financial.RequestCashAdvance_BankName;
this.LabelBankClearing.Text = Resources.Pages.Financial.RequestCashAdvance_BankClearing;
this.LabelBankAccount.Text = Resources.Pages.Financial.RequestCashAdvance_BankAccount;
this.LiteralErrorAmount.Text = String.Format(Resources.Pages.Financial.RequestCashAdvance_ValidationError_Amount, CurrentOrganization.Currency.DisplayCode);
this.LiteralErrorPurpose.Text = Resources.Pages.Financial.RequestCashAdvance_ValidationError_Purpose;
this.LiteralErrorBudget.Text = Resources.Pages.Financial.RequestCashAdvance_ValidationError_Budget;
this.LiteralErrorBankName.Text = Resources.Pages.Financial.RequestCashAdvance_ValidationError_BankName;
this.LiteralErrorBankClearing.Text =
Resources.Pages.Financial.RequestCashAdvance_ValidationError_BankClearing;
this.LiteralErrorBankAccount.Text = Resources.Pages.Financial.RequestCashAdvance_ValidationError_BankAccount;
}
@@ -114,5 +106,38 @@ namespace Swarmops.Frontend.Pages.v5.Financial
Response.Redirect ("/", true);
}
// ReSharper disable InconsistentNaming
public string Localized_ValidationError_BankAccount
{
get { return JavascriptEscape(Resources.Pages.Financial.RequestCashAdvance_ValidationError_BankAccount); }
}
public string Localized_ValidationError_BankClearing
{
get { return JavascriptEscape(Resources.Pages.Financial.RequestCashAdvance_ValidationError_BankClearing); }
}
public string Localized_ValidationError_BankName
{
get { return JavascriptEscape(Resources.Pages.Financial.RequestCashAdvance_ValidationError_BankName); }
}
public string Localized_ValidationError_Purpose
{
get { return JavascriptEscape(Resources.Pages.Financial.RequestCashAdvance_ValidationError_Purpose); }
}
public string Localized_ValidationError_Budget
{
get { return JavascriptEscape(Resources.Pages.Financial.RequestCashAdvance_ValidationError_Budget); }
}
public string Localized_ValidationError_Amount
{
get { return JavascriptEscape(String.Format(Resources.Pages.Financial.RequestCashAdvance_ValidationError_Amount, CurrentOrganization.Currency.DisplayCode)); }
}
}
}
@@ -12,60 +12,6 @@ namespace Swarmops.Frontend.Pages.v5.Financial {
public partial class RequestCashAdvance {
/// <summary>
/// LiteralErrorBankAccount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorBankAccount;
/// <summary>
/// LiteralErrorBankClearing control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorBankClearing;
/// <summary>
/// LiteralErrorBankName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorBankName;
/// <summary>
/// LiteralErrorBudget control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorBudget;
/// <summary>
/// LiteralErrorPurpose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorPurpose;
/// <summary>
/// LiteralErrorAmount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralErrorAmount;
/// <summary>
/// BoxTitle control.
/// </summary>