[Rt-commit] rt branch, hide_empty_in_title_box, updated. rt-3.8.6-124-g63e8589

Ruslan Zakirov ruz at bestpractical.com
Fri Dec 4 00:36:52 EST 2009


The branch, hide_empty_in_title_box has been updated
       via  63e85896c945d27a226da20cdceba40116cc3014 (commit)
       via  65cba426a7bcf8f4f82ff558c023eb18048fd977 (commit)
       via  28a783a697d5a3a51d3ea0c9a043dc825c001018 (commit)
      from  9031c9822980b842125f3e989660bf037fc4395c (commit)

Summary of changes:
 share/html/Elements/ShowCustomFields   |    4 ++++
 share/html/Ticket/Elements/ShowSummary |   10 +++-------
 share/html/Widgets/TitleBox            |    8 ++++++--
 3 files changed, 13 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit 28a783a697d5a3a51d3ea0c9a043dc825c001018
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Dec 2 15:00:48 2009 +0300

    don't print anything if there is no custom fields
    
    before we were printing empty <table> tag

diff --git a/share/html/Elements/ShowCustomFields b/share/html/Elements/ShowCustomFields
index ddb8b72..5b97ab9 100644
--- a/share/html/Elements/ShowCustomFields
+++ b/share/html/Elements/ShowCustomFields
@@ -80,6 +80,10 @@ $m->callback(
     CustomFields => $CustomFields,
 );
 
+# don't print anything if there is no custom fields
+return unless $CustomFields->First;
+$CustomFields->GotoFirstItem;
+
 my $print_value = sub {
     my ($cf, $value) = @_;
     my $linked = $cf->LinkValueTo;

commit 65cba426a7bcf8f4f82ff558c023eb18048fd977
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Dec 2 15:02:14 2009 +0300

    $hide_empty argument in TitleBox widget

diff --git a/share/html/Widgets/TitleBox b/share/html/Widgets/TitleBox
index 0e74377..c7c7983 100644
--- a/share/html/Widgets/TitleBox
+++ b/share/html/Widgets/TitleBox
@@ -46,9 +46,13 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <div class="<% $class %>">
-  <& TitleBoxStart, %ARGS &><% $m->content | n %><& TitleBoxEnd &>
+  <& TitleBoxStart, %ARGS &><% $content | n %><& TitleBoxEnd &>
 </div>
 <%ARGS>
 $class => ''
+$hide_empty => 0
 </%ARGS>
-
+<%INIT>
+my $content = $m->content;
+return if $hide_empty && $content =~ /^\s*$/s;
+</%INIT>

commit 63e85896c945d27a226da20cdceba40116cc3014
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Dec 4 02:25:40 2009 +0300

    use hide_empty feature instead of loading custom fields
    
    collections are not cached and we select custom fields
    twice. However, HTML::Mason has bug that don't allow
    us to merge this back. Watch the following bug:
    
    http://rt.cpan.org/Public/Bug/Display.html?id=38924

diff --git a/share/html/Ticket/Elements/ShowSummary b/share/html/Ticket/Elements/ShowSummary
index 4c2d54e..33f992a 100755
--- a/share/html/Ticket/Elements/ShowSummary
+++ b/share/html/Ticket/Elements/ShowSummary
@@ -54,13 +54,13 @@
 	        <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
 	  </&>
 
-% if ($Ticket->CustomFields->First) {
 	  <&| /Widgets/TitleBox, title => loc('Custom Fields'), 
 		title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id, 
-		class => 'ticket-info-cfs'  &> 
+		class => 'ticket-info-cfs',
+                hide_empty => 1 &> 
 	        <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &>
 	  </&>
-% }
+
 	  <&| /Widgets/TitleBox, title => loc('People'), 
 		title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id, 
 		class => 'ticket-info-people' &>
@@ -111,7 +111,3 @@
 $Ticket => undef
 $Attachments => undef
 </%ARGS>
-
-
-
-

-----------------------------------------------------------------------


More information about the Rt-commit mailing list