[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[5025] branches/1.3
- Subject: SF.net SVN: ledger-smb:[5025] branches/1.3
- From: ..hidden..
- Date: Mon, 23 Jul 2012 08:12:56 +0000
Revision: 5025
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5025&view=rev
Author: einhverfr
Date: 2012-07-23 08:12:56 +0000 (Mon, 23 Jul 2012)
Log Message:
-----------
Added container div for theming saved/posted transactions. Currently, new transactionsa re unchanged, saved ones have a blue background to the inputs, and posted ones have a white background.
Modified Paths:
--------------
branches/1.3/Changelog
branches/1.3/LedgerSMB/Form.pm
branches/1.3/UI/journal/journal_entry.html
branches/1.3/UI/lib/elements.html
branches/1.3/bin/aa.pl
branches/1.3/bin/ir.pl
branches/1.3/bin/is.pl
branches/1.3/bin/oe.pl
branches/1.3/css/ledgersmb.css
Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog 2012-07-23 07:23:56 UTC (rev 5024)
+++ branches/1.3/Changelog 2012-07-23 08:12:56 UTC (rev 5025)
@@ -4,6 +4,7 @@
Changelog for 1.3.21
* Added a default numberformat in Form.pm (Chris T)
+* Added a container div for theming saved and/or posted docs (Chris T)
Changelog for 1.3.20
* Fixes for es_AR translation, duplicate keys removed (Andres B)
Modified: branches/1.3/LedgerSMB/Form.pm
===================================================================
--- branches/1.3/LedgerSMB/Form.pm 2012-07-23 07:23:56 UTC (rev 5024)
+++ branches/1.3/LedgerSMB/Form.pm 2012-07-23 08:12:56 UTC (rev 5025)
@@ -653,6 +653,37 @@
$self->{header} = 1;
}
+=item $form->open_status_div
+
+Returns a div tag with an id of statusdiv.
+
+If $form->{id} is set and $form->{approved} the class is set to "posted" and if
+id is set but not approved, this is set to "saved." If neither applies, we set
+to "new."
+
+=cut
+
+sub open_status_div {
+ my ($self) = @_;
+ my $class;
+ if ($self->{approved} and $self->{id}){
+ $class = "posted";
+ } elsif ($self->{id}){
+ $class = "saved";
+ } else {
+ $class = "new";
+ }
+ return "<div id='statusdiv' class='$class'>";
+}
+
+=item $form->close_status_div
+
+Simply returns a </div> tag. This is included for clarity of code.
+
+=cut
+
+sub close_status_div { return '</div>'; }
+
=item $form->redirect([$msg]);
If $form->{callback} is set or $msg is not set, call the redirect function in
Modified: branches/1.3/UI/journal/journal_entry.html
===================================================================
--- branches/1.3/UI/journal/journal_entry.html 2012-07-23 07:23:56 UTC (rev 5024)
+++ branches/1.3/UI/journal/journal_entry.html 2012-07-23 08:12:56 UTC (rev 5025)
@@ -8,8 +8,8 @@
<body>
+<?lsmb INCLUDE OPEN_STATUS_DIV id=form.id approved = form.approved ?>
<form method="post" action="<?lsmb form.script ?>">
-
<table width="100%">
<tr>
<th class="listtop" ><?lsmb form.title ?></th>
@@ -352,7 +352,6 @@
<?lsmb callback = "gl.pl?action=edit&id=" _ form.id -?>
<a href="file.pl?action=show_attachment_screen&ref_key=<?lsmb form.id
?>&file_class=1&callback=<?lsmb tt_url(callback) ?>">[<?lsmb text('Attach') ?>]</a>
-<?lsmb END # IF form.id ?>
-</form>
+<?lsmb END # IF for<?lsmb INCLUDE CLOSE_STATUS_DIV id=form.id approved = form.approved ?>
</body>
-</html>
+<?lsmb INCLUDE OPEN_STATUS_DIV ?>
Modified: branches/1.3/UI/lib/elements.html
===================================================================
--- branches/1.3/UI/lib/elements.html 2012-07-23 07:23:56 UTC (rev 5024)
+++ branches/1.3/UI/lib/elements.html 2012-07-23 08:12:56 UTC (rev 5025)
@@ -348,3 +348,15 @@
<label<?lsmb label_id ?><?lsmb label_for ?><?lsmb label_class ?>><?lsmb text(element_data.label) ?></label>
<?lsmb END ?>
<?lsmb END ?>
+
+<?lsmb BLOCK OPEN_STATUS_DIV;
+ CLASS = 'new';
+ IF id and approved;
+ CLASS = 'posted';
+ ELSIF id;
+ CLASS = 'saved';
+ END;
+?><div id='statusdiv' class='<?lsmb CLASS ?>'>
+<?lsmb END ?>
+
+<?lsmb BLOCK CLOSE_STATUS_DIV ?></div><?lsmb END ?>
Modified: branches/1.3/bin/aa.pl
===================================================================
--- branches/1.3/bin/aa.pl 2012-07-23 07:23:56 UTC (rev 5024)
+++ branches/1.3/bin/aa.pl 2012-07-23 08:12:56 UTC (rev 5025)
@@ -592,9 +592,8 @@
$form->header;
print qq|
-<body onload="document.forms[0].${focus}.focus()" />
-
-
+<body onload="document.forms[0].${focus}.focus()" /> | .
+$form->open_status_div . qq|
<form method=post action=$form->{script}>
<input type=hidden name=type value="$form->{formname}">
<input type=hidden name=title value="$title">
@@ -1115,7 +1114,7 @@
print qq|
</form>
-
+| . $form->close_status_header . qq|
</body>
</html>
|;
Modified: branches/1.3/bin/ir.pl
===================================================================
--- branches/1.3/bin/ir.pl 2012-07-23 07:23:56 UTC (rev 5024)
+++ branches/1.3/bin/ir.pl 2012-07-23 08:12:56 UTC (rev 5025)
@@ -407,6 +407,7 @@
print qq|
<body onLoad="document.forms[0].${focus}.focus()" />
+| . $form->open_status_div . qq|
<form method=post action="$form->{script}">
|;
@@ -966,7 +967,7 @@
print qq|
</form>
-
+| . $form->close_status_div . qq|
</body>
</html>
|;
Modified: branches/1.3/bin/is.pl
===================================================================
--- branches/1.3/bin/is.pl 2012-07-23 07:23:56 UTC (rev 5024)
+++ branches/1.3/bin/is.pl 2012-07-23 08:12:56 UTC (rev 5025)
@@ -442,7 +442,8 @@
$form->header;
print qq|
-<body onLoad="document.forms[0].${focus}.focus()" />
+<body onLoad="document.forms[0].${focus}.focus()" />
+| . $form->open_status_div . qq|
<form method=post action="$form->{script}">
|;
@@ -1083,7 +1084,7 @@
print qq|
</form>
-
+| . $form->close_status_div . qq|
</body>
</html>
|;
Modified: branches/1.3/bin/oe.pl
===================================================================
--- branches/1.3/bin/oe.pl 2012-07-23 07:23:56 UTC (rev 5024)
+++ branches/1.3/bin/oe.pl 2012-07-23 08:12:56 UTC (rev 5025)
@@ -582,6 +582,7 @@
print qq|
<body onLoad="document.forms[0].${focus}.focus()" />
+| . $form->open_status_div . qq|
<form method=post action="$form->{script}">
|;
@@ -957,7 +958,7 @@
print qq|
</form>
-
+| . $form->close_status_div . qq|
</body>
</html>
|;
Modified: branches/1.3/css/ledgersmb.css
===================================================================
--- branches/1.3/css/ledgersmb.css 2012-07-23 07:23:56 UTC (rev 5024)
+++ branches/1.3/css/ledgersmb.css 2012-07-23 08:12:56 UTC (rev 5025)
@@ -227,6 +227,20 @@
tr.warning {
background-color: yellow;
}
+
+/* Theming controls based on transaction status */
+
+#statusdiv.new input {
+}
+
+#statusdiv.posted input {
+ background-color: white;
+}
+
+#statusdiv.saved input {
+ background-color: #ccccff;
+}
+
/* media stuff */
@media screen {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.