[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1877] trunk/UI
- Subject: SF.net SVN: ledger-smb: [1877] trunk/UI
- From: ..hidden..
- Date: Sat, 17 Nov 2007 23:36:30 -0800
Revision: 1877
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1877&view=rev
Author: einhverfr
Date: 2007-11-17 23:36:29 -0800 (Sat, 17 Nov 2007)
Log Message:
-----------
elements.html and ui-header.html are moved to UI/lib and are accessible from all html templates called from anywhere.
Minor changes to new payment templates.
Fixes to templates to add customers.
Modified Paths:
--------------
trunk/UI/Customer/customer.html
trunk/UI/payments/payment1.html
trunk/UI/payments/payment2.html
Added Paths:
-----------
trunk/UI/lib/
trunk/UI/lib/elements.html
trunk/UI/lib/ui-header.html
Removed Paths:
-------------
trunk/UI/elements.html
trunk/UI/ui-header.html
Modified: trunk/UI/Customer/customer.html
===================================================================
--- trunk/UI/Customer/customer.html 2007-11-18 06:24:22 UTC (rev 1876)
+++ trunk/UI/Customer/customer.html 2007-11-18 07:36:29 UTC (rev 1877)
@@ -1,3 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title><?lsmb form.titlebar ?></title>
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="-1" />
+ <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
+ <link rel="stylesheet" href="css/<?lsmb form.stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
+
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta name="robots" content="noindex,nofollow" />
+
+</head>
<div class="customer">
<font size="17"><?lsmb customer.name?></font>
@@ -6,9 +20,9 @@
<table>
<tr>
- <td><b>Shipping Address</b></td>
+ <td><b><?lsmb text('Shipping Address') ?></b></td>
- <td><b>Billing Address (if different)</p></td>
+ <td><b><?lsmb text('Billing Address (if different)') ?></p></td>
</tr>
@@ -17,51 +31,64 @@
<?lsmb FOREACH entry = customer.ordered ?>
<tr>
<td>
- <label for="shipping_<?entry?>"><?entry?>:</label>
- <input id="shipping_<?entry?>" type="textarea" name="shipping_<?entry?>" value="<? customer.entry ?>">
+ <label for="shipping_<?lsmb entry ?>"><?lsmb text(entry) ?>:
+ </label>
+ <input id="shipping_<?lsmb entry ?>" type="textarea"
+ name="shipping_<?lsmb entry ?>"
+ value="<?lsmb customer.entry ?>">
</td>
<td>
- <input type="textarea" name="billing_<? entry ?>" value="<? customer.entry ?>">
+ <input type="textarea" name="billing_<?lsmb entry ?>"
+ value="<?lsmb customer.entry ?>">
</td>
</tr>
- <?lsmb end ?>
+ <?lsmb END ?>
<tr>
<td>
- <label for="startdate">Starting Date:</label>
- <input id="startdate" type="textarea" name="startdate" value="<? customer.startdate ?>">
+ <label for="startdate"><?lsmb text('Starting Date:') ?></label>
+ <input id="startdate" type="textarea" name="startdate"
+ value="<?lsmb customer.startdate ?>">
</td>
<td>
- <label for="enddate">End date:</label>
- <input id="enddate" type="textarea" name="startdate" value="<? customer.enddate ?>">
+ <label for="enddate"><?lsmb('End date:') ?></label>
+ <input id="enddate" type="textarea" name="startdate"
+ value="<?lsmb customer.enddate ?>">
</td>
</tr>
<tr>
<td>
- <label for"creditlimit">Credit Limit:</label>
- <input id="creditlimit" name="creditlimit" type="textarea" value="<?customer.creditlimit?>">
+ <label for"creditlimit"><?lsmb text('Credit Limit:') ?></label>
+ <input id="creditlimit" name="creditlimit" type="textarea"
+ value="<?lsmb customer.creditlimit ?>">
</td>
<td>
- <label for="terms">Terms:</label>
- <input id="terms" name="terms" type="textarea" value="<?customer.terms?>"> days
+ <label for="terms"><?lsmb text('Terms:') ?></label>
+ <input id="terms" name="terms" type="textarea"
+ value="<?lsmb customer.terms ?>"> days
</td>
<td>
- <label for="discount">Discount %:</label>
- <input id="discount" name="discount" type="textarea" value="<?customer.discount?>">
+ <label for="discount"><?lsmb text('Discount %:') ?></label>
+ <input id="discount" name="discount" type="textarea"
+ value="<?lsmb customer.discount ?>">
</td>
</tr>
<tr>
<td>
- <label for="taxnumber">Tax Number/SSN:</label>
- <input id="taxnumber" name="taxnumber" type="textarea" value="<?customer.taxnumber?>">
+ <label for="taxnumber"><?lsmb text('Tax Number/SSN:') ?></label>
+ <input id="taxnumber" name="taxnumber" type="textarea"
+ value="<?lsmb customer.taxnumber ?>">
</td>
<td>
- <label for"gifi_accno">Subcontract GFI:</label>
- <input id="gifi_accno" name="gifi_accno" type="textarea" value="<?customer.gifi_accno?>">
+ <label for"gifi_accno"><?lsmb text('Subcontract GIFI:') ?>
+ </label>
+ <input id="gifi_accno" name="gifi_accno" type="textarea"
+ value="<?lsmb customer.gifi_accno ?>">
</td>
<td>
- <label for"sic_code">SIC Code:</label>
- <input id="sic_code" name="sic_code" type="textarea" value="<?customer.sic_code?>">
+ <label for"sic_code"><?lsmb text('SIC Code:') ?></label>
+ <input id="sic_code" name="sic_code" type="textarea"
+ value="<?lsmb customer.sic_code ?>">
</td>
</tr>
@@ -69,21 +96,26 @@
<td></td>
<td>
- <label for"bic">BIC:</label>
- <input id="bic" name="bic" type="textarea" value="<?customer.bic?>">
+ <label for"bic"><?lsmb text('BIC:') ?></label>
+ <input id="bic" name="bic" type="textarea"
+ value="<?lsmb customer.bic ?>">
</td>
<td>
- <label for="iban">IBAN:</label>
- <input id="iban" name="iban" type="textarea" value="<?customer.iban?>">
+ <label for="iban"><?lsmb text('IBAN:') ?></label>
+ <input id="iban" name="iban" type="textarea"
+ value="<?lsmb customer.iban ?>">
</td>
</tr>
<tr>
<td>
- <label for="notes">Notes:</label><br/>
- <textarea name="notes" rows="3" cols="40" id="notes">
- <?customer.notes?>
- </textarea>
+ <label for="notes"><?lsmb text('Notes:') ?></label><br/>
+ <textarea name="notes" rows="3" cols="40" id="notes"><?lsmb
+ customer.notes
+ ?></textarea>
+ <!-- The prior funny whitespace may look funny but it prevents
+ additional whitespace from being added to the data every time
+ it is saved -->
</td>
</tr>
@@ -91,7 +123,7 @@
<hr/>
<br/>
<td>
- <button class="submit" type="submit" name="action" value="save" accesskey="S" title="Save [Alt-S]">Save</button>
+ <button class="submit" type="submit" name="action" value="save" accesskey="S" title="Save [Alt-S]"><?lsmb text('Save') ?></button>
</td>
<td>
<button class="submit"
@@ -99,7 +131,8 @@
name="action"
value="ap_transaction"
accesskey="A"
- title="AP Transaction [Alt-A]">AP Transaction</button>
+ title="AP Transaction [Alt-A]">
+ <?lsmb text('AP Transaction') ?></button>
</td>
<td>
<button class="submit"
@@ -107,7 +140,8 @@
name="action"
value="customer_invoice"
accesskey="I"
- title="customer Invoice [Alt-I]">customer Invoice</button>
+ title="customer Invoice [Alt-I]">
+ <?lsmb text('Customer Invoice') ?></button>
</td>
<td>
<button class="submit"
@@ -115,7 +149,8 @@
name="action"
value="purchase_order"
accesskey="O"
- title="Purchase Order [Alt-O]">Purchase Order</button>
+ title="Purchase Order [Alt-O]">
+ <?lsmb text('Purchase Order') ?></button>
</td>
<td>
<button class="submit"
@@ -123,7 +158,7 @@
name="action"
value="rfq"
accesskey="Q"
- title="RFQ [Alt-Q]">RFQ</button>
+ title="RFQ [Alt-Q]"><?lsmb text('RFQ') ?></button>
</td>
<td>
<button class="submit"
@@ -131,9 +166,10 @@
name="action"
value="pricelist"
accesskey="P"
- title="Pricelist [Alt-P]">Pricelist</button>
+ title="Pricelist [Alt-P]">
+ <?lsmb text('Pricelist') ?></button>
</td>
</tr>
</table>
</form>
-</div>
\ No newline at end of file
+</div>
Deleted: trunk/UI/elements.html
===================================================================
--- trunk/UI/elements.html 2007-11-18 06:24:22 UTC (rev 1876)
+++ trunk/UI/elements.html 2007-11-18 07:36:29 UTC (rev 1877)
@@ -1,264 +0,0 @@
-<?lsmb
- default_keys = ['id', 'class', 'title'] # Defaults for all attributes
- input_keys = ['type', 'name', 'disabled', 'size', 'value'] # Defaults for input attributes
-
- # ELEMENT DEFAULTS
-
- #checkbox
- checkbox_defaults = {
- value = '1'
- }
-
- #file
- file_defaults = {
- size => '60'
- }
-
- #password
- password_defaults = {
- size = '60'
- }
-
- # text
- text_defaults = {
- size = '60',
- maxlength = '255'
- }
-
- # textarea
- textarea_defaults = {
- rows = '5',
- cols = '60'
- }
-
- #button
- button_defaults = {
- type = 'submit'
- }
-
-?>
-
-<?lsmb # INPUT ELEMENT ?>
-<?lsmb BLOCK input ?>
- <?lsmb IF element_data # Only process element if one exists. ?>
- <?lsmb
- input_defaults = {} # Some inputs have no defaults, so make sure everything is empty to start with.
- element_type = 'input';
- PROCESS auto_id;
- ?>
- <?lsmb SWITCH element_data.type; # Merge in type-specific attributes.
- CASE 'file';
- input_type_keys = input_keys.merge(['accept']);
- input_defaults = file_defaults;
- CASE 'image';
- input_type_keys = input_keys.merge(['alt', 'src']);
- CASE ['checkbox'];
- input_type_keys = input_keys.merge(['checked']);
- input_defaults = checkbox_defaults;
- CASE ['radio'];
- input_type_keys = input_keys.merge(['checked']);
- CASE ['password'];
- input_defaults = password_defaults;
- CASE 'text';
- input_type_keys = input_keys.merge(['maxlength', 'readonly']);
- input_defaults = text_defaults;
- CASE;
- input_type_keys = input_keys;
- END;
- ?>
- <?lsmb PROCESS attributes # Process regular attributes.
- attribute_data = element_data
- attribute_defaults = input_defaults
- element_keys = input_type_keys
- ?>
- <?lsmb PROCESS custom_attributes # Process custom attributes.
- custom_attribute_data=element_data.attributes
- ?>
- <?lsmb PROCESS auto_label # Process element label. ?>
- <input<?lsmb all_attributes ?><?lsmb all_custom_attributes ?> />
- <?lsmb END ?>
-<?lsmb END ?>
-
-<?lsmb # TEXTAREA ELEMENT ?>
-<?lsmb BLOCK textarea ?>
- <?lsmb IF element_data # Only process element if one exists. ?>
- <?lsmb
- element_type = 'textarea';
- PROCESS auto_id;
- ?>
- <?lsmb PROCESS attributes # Process regular attributes.
- attribute_data=element_data
- attribute_defaults = textarea_defaults
- element_keys = ['name', 'cols', 'rows', 'disabled', 'readonly', 'tabindex', 'accesskey', 'value'] # Attributes that apply to textareas.
- ?>
- <?lsmb PROCESS custom_attributes # Process custom attributes.
- custom_attribute_data=element_data.attributes
- ?>
- <?lsmb PROCESS auto_label # Process element label. ?>
- <textarea<?lsmb all_attributes ?><?lsmb all_custom_attributes ?>><?lsmb element_data.text ?></textarea>
- <?lsmb END ?>
-<?lsmb END ?>
-
-<?lsmb # SELECT ELEMENT ?>
-<?lsmb BLOCK select ?>
- <?lsmb IF element_data # Only process element if one exists. ?>
- <?lsmb IF element_data.defined('default_values') ?>
- <?lsmb # Undef items must be removed, or they choke in the options defaults check later.
- i = 0;
- FOREACH select_default IN element_data.default_values;
- UNLESS select_default.defined;
- element_data.default_values = element_data.default_values.splice(1, i);
- END;
- i = i + 1;
- END;
- ?>
- <?lsmb END ?>
- <?lsmb
- element_type = 'select';
- PROCESS auto_id;
- ?>
- <?lsmb PROCESS attributes # Process regular attributes.
- attribute_data=element_data
- attribute_defaults = {} # Make sure old defaults are cleared out.
- element_keys=['name', 'size', 'multiple', 'disabled', 'accesskey', 'tabindex'] # Attributes that apply to selects.
- ?>
- <?lsmb PROCESS custom_attributes # Process custom attributes.
- custom_attribute_data=element_data.attributes
- ?>
- <?lsmb PROCESS auto_label # Process element label. ?>
- <select<?lsmb all_attributes ?><?lsmb all_custom_attributes ?>>
- <?lsmb # Build options.
- FOREACH option_data IN element_data.options;
- PROCESS option;
- END;
- ?>
- </select>
- <?lsmb END ?>
-<?lsmb END ?>
-
-<?lsmb # OPTION ELEMENT ?>
-<?lsmb BLOCK option ?>
- <?lsmb # Selected is a special case -- no attribute key, so it's handled here by looking for the option value in the default_values key.
- IF element_data.defined('default_values') AND element_data.default_values.grep("^${option_data.value}$").size;
- option_data.selected = ' selected="selected"';
- ELSE;
- option_data.selected = "";
- END;
- ?>
- <?lsmb PROCESS attributes # Process regular attributes.
- attribute_data=option_data
- element_keys=['tabindex', 'disabled', 'value'] # Attributes that apply to options.
- ?>
- <?lsmb PROCESS custom_attributes # Process custom attributes.
- custom_attribute_data=option_data.attributes
- ?>
- <option<?lsmb all_attributes ?><?lsmb all_custom_attributes ?><?lsmb option_data.selected ?>><?lsmb option_data.text ?></option>
-<?lsmb END ?>
-
-<?lsmb # BUTTON ELEMENT ?>
-<?lsmb BLOCK button ?>
- <?lsmb IF element_data # Only process element if one exists. ?>
- <?lsmb
- element_type = 'button';
- PROCESS auto_id;
- ?>
- <?lsmb PROCESS attributes # Process regular attributes.
- attribute_data=element_data
- attribute_defaults = button_defaults
- element_keys=['name', 'value', 'accesskey', 'type', 'disabled', 'tabindex'] # Attributes that apply to buttons.
- ?>
- <?lsmb PROCESS custom_attributes # Process custom attributes.
- custom_attribute_data=element_data.attributes
- ?>
- <?lsmb PROCESS auto_label # Process element label. ?>
- <button<?lsmb all_attributes ?><?lsmb all_custom_attributes ?>><?lsmb element_data.text ?></button>
- <?lsmb END ?>
-<?lsmb END ?>
-
-<?lsmb # LABEL ELEMENT ?>
-<?lsmb BLOCK label ?>
- <?lsmb IF element_data # Only process element if one exists. ?>
- <?lsmb
- element_type = 'label';
- PROCESS auto_id;
- ?>
- <?lsmb PROCESS attributes
- attribute_data=element_data
- attribute_defaults = {} # Make sure old defaults are cleared out.
- element_keys=['for'] # Attributes that apply to labels.
- ?>
- <?lsmb PROCESS custom_attributes
- custom_attribute_data=element_data.attributes
- ?>
- <label<?lsmb all_attributes ?><?lsmb all_custom_attributes ?>><?lsmb element_data.text ?></label>
- <?lsmb END ?>
-<?lsmb END ?>
-
-<?lsmb # REGULAR ATTRIBUTE PROCESSING -- all explicitly allowed attributes are processed here. ?>
-<?lsmb BLOCK attributes ?>
- <?lsmb
- all_attributes = ""
- all_keys = default_keys.merge(element_keys) # Merge in attributes that apply to this element.
- ?>
- <?lsmb FOREACH element_attribute IN all_keys # Loop through each allowed attribute. ?>
- <?lsmb
- IF attribute_data.defined(element_attribute); # Add the attribute to the element if it's been set.
- all_attributes = all_attributes _ " " _ element_attribute _ '="' _ attribute_data.${element_attribute} _ '"';
- ELSIF attribute_defaults.defined(element_attribute); # Fall back to default value if one is supplied.
- all_attributes = all_attributes _ " " _ element_attribute _ '="' _ attribute_defaults.${element_attribute} _ '"';
- END;
- ?>
- <?lsmb END ?>
-<?lsmb END ?>
-
-<?lsmb # CUSTOM ATTRIBUTE PROCESSING -- any other attributes passed in the 'attributes' key are processed here. ?>
-<?lsmb BLOCK custom_attributes ?>
- <?lsmb all_custom_attributes = "" ?>
- <?lsmb # Loop through each attribute and add it to the custom attribute string.
- FOREACH element_attribute IN custom_attribute_data;
- all_custom_attributes = all_custom_attributes _ " " _ element_attribute.key _ '="' _ element_attribute.value _ '"';
- END;
- ?>
-<?lsmb END ?>
-
-<?lsmb BLOCK auto_id # Automatically builds the id tag for the element if possible. ?>
- <?lsmb UNLESS element_data.defined('id') # id attribute should always be set, so auto-set it if it's not defined. ?>
- <?lsmb element_id = "" ?>
- <?lsmb # Labal id's default to [for]-label.
- IF element_type == 'label' AND element_data.defined('for');
- element_id = element_data.for _ "-label";
- ELSIF ((element_type == 'input' AND element_data.type == 'radio') OR element_type == 'button') AND element_data.defined('name') AND element_data.defined('value');
- element_id = element_data.name _ "-" _ element_data.value; # radios and buttons get name-value for uniqueness.
- ELSIF (element_type == 'input' OR element_type == 'textarea' OR element_type == 'select') AND element_data.defined('name');
- element_id = element_data.name;
- END;
- ?>
- <?lsmb # Add the id if it's been generated. Replace all non alphanumeric characters with dashes -- nicer CSS.
- IF element_id;
- element_data.id = element_id.replace('[^\p{IsAlnum}]', '-');
- END;
- ?>
- <?lsmb END ?>
-<?lsmb END ?>
-
-<?lsmb BLOCK auto_label # Sets a label for a form element if the special 'label' key is passed. ?>
- <?lsmb IF element_data.defined('label') # Check for label. ?>
- <?lsmb # Add a for attribute for the label if possible.
- IF element_data.defined('id');
- label_id = ' id="' _ element_data.id _ '-label"';
- label_for = ' for="' _ element_data.id _ '"';
- ELSE;
- label_id = "";
- label_for = "";
- END;
- ?>
- <?lsmb # Label inherits class of the related element if possible.
- IF element_data.defined('class');
- label_class = ' class="' _ element_data.class _ '"';
- ELSE;
- label_class = "";
- END;
- ?>
- <label<?lsmb label_id ?><?lsmb label_for ?><?lsmb label_class ?>><?lsmb text(element_data.label) ?></label>
- <?lsmb END ?>
-<?lsmb END ?>
Copied: trunk/UI/lib/elements.html (from rev 1870, trunk/UI/elements.html)
===================================================================
--- trunk/UI/lib/elements.html (rev 0)
+++ trunk/UI/lib/elements.html 2007-11-18 07:36:29 UTC (rev 1877)
@@ -0,0 +1,264 @@
+<?lsmb
+ default_keys = ['id', 'class', 'title'] # Defaults for all attributes
+ input_keys = ['type', 'name', 'disabled', 'size', 'value'] # Defaults for input attributes
+
+ # ELEMENT DEFAULTS
+
+ #checkbox
+ checkbox_defaults = {
+ value = '1'
+ }
+
+ #file
+ file_defaults = {
+ size => '60'
+ }
+
+ #password
+ password_defaults = {
+ size = '60'
+ }
+
+ # text
+ text_defaults = {
+ size = '60',
+ maxlength = '255'
+ }
+
+ # textarea
+ textarea_defaults = {
+ rows = '5',
+ cols = '60'
+ }
+
+ #button
+ button_defaults = {
+ type = 'submit'
+ }
+
+?>
+
+<?lsmb # INPUT ELEMENT ?>
+<?lsmb BLOCK input ?>
+ <?lsmb IF element_data # Only process element if one exists. ?>
+ <?lsmb
+ input_defaults = {} # Some inputs have no defaults, so make sure everything is empty to start with.
+ element_type = 'input';
+ PROCESS auto_id;
+ ?>
+ <?lsmb SWITCH element_data.type; # Merge in type-specific attributes.
+ CASE 'file';
+ input_type_keys = input_keys.merge(['accept']);
+ input_defaults = file_defaults;
+ CASE 'image';
+ input_type_keys = input_keys.merge(['alt', 'src']);
+ CASE ['checkbox'];
+ input_type_keys = input_keys.merge(['checked']);
+ input_defaults = checkbox_defaults;
+ CASE ['radio'];
+ input_type_keys = input_keys.merge(['checked']);
+ CASE ['password'];
+ input_defaults = password_defaults;
+ CASE 'text';
+ input_type_keys = input_keys.merge(['maxlength', 'readonly']);
+ input_defaults = text_defaults;
+ CASE;
+ input_type_keys = input_keys;
+ END;
+ ?>
+ <?lsmb PROCESS attributes # Process regular attributes.
+ attribute_data = element_data
+ attribute_defaults = input_defaults
+ element_keys = input_type_keys
+ ?>
+ <?lsmb PROCESS custom_attributes # Process custom attributes.
+ custom_attribute_data=element_data.attributes
+ ?>
+ <?lsmb PROCESS auto_label # Process element label. ?>
+ <input<?lsmb all_attributes ?><?lsmb all_custom_attributes ?> />
+ <?lsmb END ?>
+<?lsmb END ?>
+
+<?lsmb # TEXTAREA ELEMENT ?>
+<?lsmb BLOCK textarea ?>
+ <?lsmb IF element_data # Only process element if one exists. ?>
+ <?lsmb
+ element_type = 'textarea';
+ PROCESS auto_id;
+ ?>
+ <?lsmb PROCESS attributes # Process regular attributes.
+ attribute_data=element_data
+ attribute_defaults = textarea_defaults
+ element_keys = ['name', 'cols', 'rows', 'disabled', 'readonly', 'tabindex', 'accesskey', 'value'] # Attributes that apply to textareas.
+ ?>
+ <?lsmb PROCESS custom_attributes # Process custom attributes.
+ custom_attribute_data=element_data.attributes
+ ?>
+ <?lsmb PROCESS auto_label # Process element label. ?>
+ <textarea<?lsmb all_attributes ?><?lsmb all_custom_attributes ?>><?lsmb element_data.text ?></textarea>
+ <?lsmb END ?>
+<?lsmb END ?>
+
+<?lsmb # SELECT ELEMENT ?>
+<?lsmb BLOCK select ?>
+ <?lsmb IF element_data # Only process element if one exists. ?>
+ <?lsmb IF element_data.defined('default_values') ?>
+ <?lsmb # Undef items must be removed, or they choke in the options defaults check later.
+ i = 0;
+ FOREACH select_default IN element_data.default_values;
+ UNLESS select_default.defined;
+ element_data.default_values = element_data.default_values.splice(1, i);
+ END;
+ i = i + 1;
+ END;
+ ?>
+ <?lsmb END ?>
+ <?lsmb
+ element_type = 'select';
+ PROCESS auto_id;
+ ?>
+ <?lsmb PROCESS attributes # Process regular attributes.
+ attribute_data=element_data
+ attribute_defaults = {} # Make sure old defaults are cleared out.
+ element_keys=['name', 'size', 'multiple', 'disabled', 'accesskey', 'tabindex'] # Attributes that apply to selects.
+ ?>
+ <?lsmb PROCESS custom_attributes # Process custom attributes.
+ custom_attribute_data=element_data.attributes
+ ?>
+ <?lsmb PROCESS auto_label # Process element label. ?>
+ <select<?lsmb all_attributes ?><?lsmb all_custom_attributes ?>>
+ <?lsmb # Build options.
+ FOREACH option_data IN element_data.options;
+ PROCESS option;
+ END;
+ ?>
+ </select>
+ <?lsmb END ?>
+<?lsmb END ?>
+
+<?lsmb # OPTION ELEMENT ?>
+<?lsmb BLOCK option ?>
+ <?lsmb # Selected is a special case -- no attribute key, so it's handled here by looking for the option value in the default_values key.
+ IF element_data.defined('default_values') AND element_data.default_values.grep("^${option_data.value}$").size;
+ option_data.selected = ' selected="selected"';
+ ELSE;
+ option_data.selected = "";
+ END;
+ ?>
+ <?lsmb PROCESS attributes # Process regular attributes.
+ attribute_data=option_data
+ element_keys=['tabindex', 'disabled', 'value'] # Attributes that apply to options.
+ ?>
+ <?lsmb PROCESS custom_attributes # Process custom attributes.
+ custom_attribute_data=option_data.attributes
+ ?>
+ <option<?lsmb all_attributes ?><?lsmb all_custom_attributes ?><?lsmb option_data.selected ?>><?lsmb option_data.text ?></option>
+<?lsmb END ?>
+
+<?lsmb # BUTTON ELEMENT ?>
+<?lsmb BLOCK button ?>
+ <?lsmb IF element_data # Only process element if one exists. ?>
+ <?lsmb
+ element_type = 'button';
+ PROCESS auto_id;
+ ?>
+ <?lsmb PROCESS attributes # Process regular attributes.
+ attribute_data=element_data
+ attribute_defaults = button_defaults
+ element_keys=['name', 'value', 'accesskey', 'type', 'disabled', 'tabindex'] # Attributes that apply to buttons.
+ ?>
+ <?lsmb PROCESS custom_attributes # Process custom attributes.
+ custom_attribute_data=element_data.attributes
+ ?>
+ <?lsmb PROCESS auto_label # Process element label. ?>
+ <button<?lsmb all_attributes ?><?lsmb all_custom_attributes ?>><?lsmb element_data.text ?></button>
+ <?lsmb END ?>
+<?lsmb END ?>
+
+<?lsmb # LABEL ELEMENT ?>
+<?lsmb BLOCK label ?>
+ <?lsmb IF element_data # Only process element if one exists. ?>
+ <?lsmb
+ element_type = 'label';
+ PROCESS auto_id;
+ ?>
+ <?lsmb PROCESS attributes
+ attribute_data=element_data
+ attribute_defaults = {} # Make sure old defaults are cleared out.
+ element_keys=['for'] # Attributes that apply to labels.
+ ?>
+ <?lsmb PROCESS custom_attributes
+ custom_attribute_data=element_data.attributes
+ ?>
+ <label<?lsmb all_attributes ?><?lsmb all_custom_attributes ?>><?lsmb element_data.text ?></label>
+ <?lsmb END ?>
+<?lsmb END ?>
+
+<?lsmb # REGULAR ATTRIBUTE PROCESSING -- all explicitly allowed attributes are processed here. ?>
+<?lsmb BLOCK attributes ?>
+ <?lsmb
+ all_attributes = ""
+ all_keys = default_keys.merge(element_keys) # Merge in attributes that apply to this element.
+ ?>
+ <?lsmb FOREACH element_attribute IN all_keys # Loop through each allowed attribute. ?>
+ <?lsmb
+ IF attribute_data.defined(element_attribute); # Add the attribute to the element if it's been set.
+ all_attributes = all_attributes _ " " _ element_attribute _ '="' _ attribute_data.${element_attribute} _ '"';
+ ELSIF attribute_defaults.defined(element_attribute); # Fall back to default value if one is supplied.
+ all_attributes = all_attributes _ " " _ element_attribute _ '="' _ attribute_defaults.${element_attribute} _ '"';
+ END;
+ ?>
+ <?lsmb END ?>
+<?lsmb END ?>
+
+<?lsmb # CUSTOM ATTRIBUTE PROCESSING -- any other attributes passed in the 'attributes' key are processed here. ?>
+<?lsmb BLOCK custom_attributes ?>
+ <?lsmb all_custom_attributes = "" ?>
+ <?lsmb # Loop through each attribute and add it to the custom attribute string.
+ FOREACH element_attribute IN custom_attribute_data;
+ all_custom_attributes = all_custom_attributes _ " " _ element_attribute.key _ '="' _ element_attribute.value _ '"';
+ END;
+ ?>
+<?lsmb END ?>
+
+<?lsmb BLOCK auto_id # Automatically builds the id tag for the element if possible. ?>
+ <?lsmb UNLESS element_data.defined('id') # id attribute should always be set, so auto-set it if it's not defined. ?>
+ <?lsmb element_id = "" ?>
+ <?lsmb # Labal id's default to [for]-label.
+ IF element_type == 'label' AND element_data.defined('for');
+ element_id = element_data.for _ "-label";
+ ELSIF ((element_type == 'input' AND element_data.type == 'radio') OR element_type == 'button') AND element_data.defined('name') AND element_data.defined('value');
+ element_id = element_data.name _ "-" _ element_data.value; # radios and buttons get name-value for uniqueness.
+ ELSIF (element_type == 'input' OR element_type == 'textarea' OR element_type == 'select') AND element_data.defined('name');
+ element_id = element_data.name;
+ END;
+ ?>
+ <?lsmb # Add the id if it's been generated. Replace all non alphanumeric characters with dashes -- nicer CSS.
+ IF element_id;
+ element_data.id = element_id.replace('[^\p{IsAlnum}]', '-');
+ END;
+ ?>
+ <?lsmb END ?>
+<?lsmb END ?>
+
+<?lsmb BLOCK auto_label # Sets a label for a form element if the special 'label' key is passed. ?>
+ <?lsmb IF element_data.defined('label') # Check for label. ?>
+ <?lsmb # Add a for attribute for the label if possible.
+ IF element_data.defined('id');
+ label_id = ' id="' _ element_data.id _ '-label"';
+ label_for = ' for="' _ element_data.id _ '"';
+ ELSE;
+ label_id = "";
+ label_for = "";
+ END;
+ ?>
+ <?lsmb # Label inherits class of the related element if possible.
+ IF element_data.defined('class');
+ label_class = ' class="' _ element_data.class _ '"';
+ ELSE;
+ label_class = "";
+ END;
+ ?>
+ <label<?lsmb label_id ?><?lsmb label_for ?><?lsmb label_class ?>><?lsmb text(element_data.label) ?></label>
+ <?lsmb END ?>
+<?lsmb END ?>
Copied: trunk/UI/lib/ui-header.html (from rev 1870, trunk/UI/ui-header.html)
===================================================================
--- trunk/UI/lib/ui-header.html (rev 0)
+++ trunk/UI/lib/ui-header.html 2007-11-18 07:36:29 UTC (rev 1877)
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title><?lsmb form.titlebar ?></title>
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="-1" />
+ <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
+ <link rel="stylesheet" href="css/<?lsmb form.stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
+
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta name="robots" content="noindex,nofollow" />
+
+</head>
Modified: trunk/UI/payments/payment1.html
===================================================================
--- trunk/UI/payments/payment1.html 2007-11-18 06:24:22 UTC (rev 1876)
+++ trunk/UI/payments/payment1.html 2007-11-18 07:36:29 UTC (rev 1877)
@@ -17,7 +17,7 @@
<form name="search" method="post" action="payment.pl">
-<?lsmb PROCESS '../elements.html' # Include form elements helper. ?>
+<?lsmb PROCESS 'elements.html' # Include form elements helper. ?>
<?lsmb PROCESS input element_data=sort ?>
<?lsmb PROCESS input element_data=nextsub ?>
Modified: trunk/UI/payments/payment2.html
===================================================================
--- trunk/UI/payments/payment2.html 2007-11-18 06:24:22 UTC (rev 1876)
+++ trunk/UI/payments/payment2.html 2007-11-18 07:36:29 UTC (rev 1877)
@@ -14,7 +14,7 @@
<body id="payment_2_body">
<form name="pay_single_dues" method="post" action="payment.pl">
- <?lsmb PROCESS ../elements.html # Include form elements helper. ?>
+ <?lsmb PROCESS elements.html # Include form elements helper. ?>
<table width=100%>
<tr id="top_bar" class="listtop">
Deleted: trunk/UI/ui-header.html
===================================================================
--- trunk/UI/ui-header.html 2007-11-18 06:24:22 UTC (rev 1876)
+++ trunk/UI/ui-header.html 2007-11-18 07:36:29 UTC (rev 1877)
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title><?lsmb form.titlebar ?></title>
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Expires" content="-1" />
- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
- <link rel="stylesheet" href="css/<?lsmb form.stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
-
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <meta name="robots" content="noindex,nofollow" />
-
-</head>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.