Skip to content
Browse files

updated the fragments view to hide its header when the default list (…

…All) is empty
  • Loading branch information...
1 parent 51013bd commit 6d13ea913b4cfc7502417ffb9a85942968a26c6d @marubinotto committed
View
4 src/main/java/marubinotto/piggydb/ui/page/partial/AbstractFragments.java
@@ -58,9 +58,11 @@ public void onInit() {
//
public FragmentsView view;
+
+ public String label;
+ public boolean hideHeader = false;
public Page<Fragment> fragments;
- public String label;
public Classification contextTags;
public boolean firstSet = true;
View
2 src/main/java/marubinotto/piggydb/ui/page/partial/FragmentsByDate.java
@@ -23,6 +23,8 @@ protected void setFragments() throws Exception {
FragmentsQuery query = getQuery(FragmentsAllButTrash.class);
this.fragments = getPage(query);
this.label = getMessage("all");
+ if (this.fragments.getTotalSize() == 0)
+ this.hideHeader = true;
}
}
}
View
2 src/main/webapp/macro/fragments.vm
@@ -90,6 +90,7 @@ jQuery(function() {
#macro ( fragmentsViewContent $view $fragments $contextTags $firstSet $lastSet )
+#if (!$hideHeader)
<script type="text/javascript">
//<![CDATA[
jQuery(function() {
@@ -100,6 +101,7 @@ jQuery(function() {
});
//]]>
</script>
+#end
#if ($fragments && $fragments.size() > 0)

0 comments on commit 6d13ea9

Please sign in to comment.
Something went wrong with that request. Please try again.