Skip to content

Commit

Permalink
fixes #155
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed May 28, 2014
1 parent 9a334c7 commit 299ca00
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ angular.module('mc.core.ui.bs.catalogueElementTreeview', ['mc.core.ui.catalogueE
<catalogue-element-treeview-item element="item" descend="descend" root-id="id" repeat="repeat" ng-repeat="item in children"></catalogue-element-treeview-item>
<li ng-switch-when="list" ng-if="hasMore" class="catalogue-element-treeview-item">
<span class="catalogue-element-treeview-labels" ng-click="showMore()">
<a ng-click="showMore()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a> <a ng-click="showMore()">Show more</a>
<a class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a> <a>Show more</a>
</span>
</li>
<catalogue-element-treeview-item element="element" descend="descend" root-id="id" repeat="repeat" ng-switch-when="element"></catalogue-element-treeview-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ angular.module('mc.core.ui.bs.catalogueElementTreeviewItem', ['mc.core.ui.catalo
<a ng-if="!currentDescend &amp;&amp; element.elementType" class="btn btn-link">
<span class="glyphicon glyphicon-file"></span>
</a>
<span class="catalogue-element-treeview-name" ng-click="select(element)">{{element.name}}</span>
<span class="catalogue-element-treeview-name" ng-click="select(element)">{{element.name}} ({{element.id}})</span>
<a ng-click="element.show()" class="btn btn-link btn-xs" title="Show" ng-if="element.elementType"><span class="glyphicon glyphicon-link"></span></a>
</span>
</div>
<ul ng-if="children" ng-hide="collapsed" class="catalogue-element-treeview-list">
<catalogue-element-treeview-item element="child" descend="nextDescend" repeat="repeat" ng-repeat="child in children track by $index" root-id="rootId"></catalogue-element-treeview-item>
<li ng-if="hasMore" class="catalogue-element-treeview-item">
<span class="catalogue-element-treeview-labels" ng-click="showMore()">
<a ng-click="showMore()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a> <a ng-click="showMore()">Show more</a>
<a class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a> <a>Show more</a>
</span>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ angular.module('mc.core.ui.catalogueElementTreeviewItem', ['mc.util.names', 'mc.

compile: recursiveCompile.compile

controller: ['$scope', '$rootScope', ($scope, $rootScope) ->
controller: ['$scope', '$rootScope', '$log', ($scope, $rootScope, $log) ->
$scope.loadingChildren = false

isEqual = (a, b) ->
Expand All @@ -23,9 +23,12 @@ angular.module('mc.core.ui.catalogueElementTreeviewItem', ['mc.util.names', 'mc.

createShowMore = (list) ->
->
$log.info "this is ", this
list.next().then (nextList) ->
$log.info "adding items to children ", $scope.children, " from ", nextList
for item in nextList.list
$scope.children.push(item.relation)
$log.info "new children are", $scope.children
$scope.hasMore = $scope.numberOfChildren > $scope.children.length
$scope.showMore = createShowMore(nextList)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class ModelService {
select distinct m
from Model m
where m.status = :status and m.id not in (select distinct r.destination.id from Relationship r where r.relationshipType = :type)
group by m.name
order by m.name
""", [type: hierarchy, status: status], params)

Long count = Model.executeQuery("""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class BootStrap {
de.ext.metadata = "test metadata"

15.times {
new Model(name: "Another root #${it}").save()
new Model(name: "Another root #${String.format('%03d', it)}").save()
}

def parentModel1 = Model.findByName("Another root #1")
def parentModel1 = Model.findByName("Another root #001")

15.times{
def child = new Model(name: "Another root #${it}").save()
def child = new Model(name: "Another root #${String.format('%03d', it)}").save()
parentModel1.addToParentOf(child)
}

Expand Down

0 comments on commit 299ca00

Please sign in to comment.