diff --git a/templates/dataset_code.tmpl b/templates/dataset_code.tmpl
index 9c67a35b3db..ec9fba237fc 100644
--- a/templates/dataset_code.tmpl
+++ b/templates/dataset_code.tmpl
@@ -77,6 +77,9 @@
#end def
+## FIXME: This function is duplicated in history.tmpl!
+## This copy is used for rendering datasets when the client's javascript
+## is enabled.
#def render_dataset( $data, $hid )
#if $data.state in ["no state","",None]:
@@ -157,7 +160,7 @@
#if $data.has_data:
save
- #for $display_app in $data.datatype.get_display_types():
+ #for $display_app in $data.datatype.get_display_types():
#set $display_links = $data.datatype.get_display_links($data, $display_app, $app, $request.base)
#if $len($display_links) > 0:
| $data.datatype.get_display_label($display_app)
@@ -176,18 +179,25 @@
##
## Child datasets
##
-
+
#if $len( $data.children ) > 0:
-
- There are ${len( $data.children )} secondary datasets.
- #for $idx, $child_assoc in $enumerate($data.children)
- #set $child = $child_assoc.child
- $render_dataset( $child, $idx + 1 )
- #end for
-
- #end if
-
-
+ #set $children = []
+ #for $child_assoc in $data.children:
+ #if $child_assoc.child.visible:
+ $children.append($child_assoc.child)
+ #end if
+ #end for
+ #if $len( $children ) > 0:
+
+ There are ${len( $children )} secondary datasets.
+ #for $idx, $child in $enumerate($children)
+ $render_dataset( $child, $idx + 1 )
+ #end for
+
+ #end if
+ #end if
+
+
#end def
diff --git a/templates/history.tmpl b/templates/history.tmpl
index 88d12d3bfd4..0df138b68ba 100644
--- a/templates/history.tmpl
+++ b/templates/history.tmpl
@@ -146,7 +146,9 @@ div#footer {
## Render the dataset `$data`, using `$hid` as the displayed id
##
-## FIXME: duplicated in dataset_code, argh!
+## FIXME: This function is duplicated in dataset_code.tmpl!
+## This copy is used for rendering datasets when the client's javascript
+## is NOT enabled.
#def render_dataset( $data, $hid )
#if $data.state in ["no state","",None]: