[Bps-public-commit] rt-extension-assets branch, 1.0/add-catalog-css-class, created. 0c1ba1037264d0944c366baacfe0fd6ef67355c7
Jim Brandt
jbrandt at bestpractical.com
Fri Jan 10 13:52:19 EST 2014
The branch, 1.0/add-catalog-css-class has been created
at 0c1ba1037264d0944c366baacfe0fd6ef67355c7 (commit)
- Log -----------------------------------------------------------------
commit 0c1ba1037264d0944c366baacfe0fd6ef67355c7
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Fri Jan 10 13:51:59 2014 -0500
Add catalog name to css class on Basics
diff --git a/html/Asset/Elements/EditBasics b/html/Asset/Elements/EditBasics
index 8e6be66..6dd4366 100644
--- a/html/Asset/Elements/EditBasics
+++ b/html/Asset/Elements/EditBasics
@@ -47,20 +47,20 @@
%# END BPS TAGGED BLOCK }}}
<table>
% if ($AssetObj->id) {
- <tr class="asset-catalog">
+ <tr class="asset-catalog <% $catalog_name %>">
<td class="label"><label for="Catalog"><&|/l&>Catalog</&>:</label></td>
<td><& /Asset/Elements/SelectCatalog, Default => $current{Catalog} &></td>
</tr>
% }
- <tr class="asset-name">
+ <tr class="asset-name <% $catalog_name %>">
<td class="label"><label for="Name"><&|/l&>Name</&>:</label></td>
<td><input name="Name" value="<% $current{Name} %>" size="50"></td>
</tr>
- <tr class="asset-description">
+ <tr class="asset-description <% $catalog_name %>">
<td class="label"><label for="Description"><&|/l&>Description</&>:</label></td>
<td><input name="Description" value="<% $current{Description} %>" size="75"></td>
</tr>
- <tr class="asset-status">
+ <tr class="asset-status <% $catalog_name %>">
<td class="label"><label for="Status"><&|/l&>Status</&>:</label></td>
<td><& /Asset/Elements/SelectStatus, Name => 'Status', AssetObj => $AssetObj, CatalogObj => $CatalogObj &></td>
</tr>
@@ -80,6 +80,12 @@ $AssetObj
$CatalogObj => undef
</%args>
<%init>
+my $catalog_name = $AssetObj->CatalogObj->Id ? $AssetObj->CatalogObj->Name : '';
+
+# Use CatalogObj if we get it.
+$catalog_name = $CatalogObj->Name if $CatalogObj;
+$catalog_name = join '-', map {lc $_} split (/ /, $catalog_name);
+
my %current = map { $_ => ($ARGS{$_} || $AssetObj->$_ || '') }
$AssetObj->WritableAttributes;
</%init>
diff --git a/html/Asset/Elements/ShowBasics b/html/Asset/Elements/ShowBasics
index afe377f..d99afe4 100644
--- a/html/Asset/Elements/ShowBasics
+++ b/html/Asset/Elements/ShowBasics
@@ -46,19 +46,19 @@
%#
%# END BPS TAGGED BLOCK }}}
<table>
- <tr class="asset-catalog">
+ <tr class="asset-catalog <% $catalog_name %>">
<td class="label"><&|/l&>Catalog</&>:</td>
<td><& ShowCatalog, Asset => $AssetObj &></td>
</tr>
- <tr class="asset-name">
+ <tr class="asset-name <% $catalog_name %>">
<td class="label"><&|/l&>Name</&>:</td>
<td><% $AssetObj->Name || '' %></td>
</tr>
- <tr class="asset-description">
+ <tr class="asset-description <% $catalog_name %>">
<td class="label"><&|/l&>Description</&>:</td>
<td><% $AssetObj->Description || '' %></td>
</tr>
- <tr class="asset-status">
+ <tr class="asset-status <% $catalog_name %>">
<td class="label"><&|/l&>Status</&>:</td>
<td class="value"><% loc($AssetObj->Status) %></td>
</tr>
@@ -68,3 +68,7 @@
<%args>
$AssetObj
</%args>
+<%init>
+my $catalog_name = $AssetObj->CatalogObj->Id ? $AssetObj->CatalogObj->Name : '';
+$catalog_name = join '-', map {lc $_} split (/ /, $catalog_name);
+</%init>
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list