Index: Tools/GardeningServer/ui/ct-commit-list.html |
diff --git a/Tools/GardeningServer/ui/ct-commit-list.html b/Tools/GardeningServer/ui/ct-commit-list.html |
index 6ff19411001d97a75351606affa88d8304cde383..6ff1d83f4fe6bac5602f02cc9afb021c27491f2c 100644 |
--- a/Tools/GardeningServer/ui/ct-commit-list.html |
+++ b/Tools/GardeningServer/ui/ct-commit-list.html |
@@ -5,6 +5,7 @@ found in the LICENSE file. |
--> |
<link rel="import" href="ct-commit.html"> |
+<link rel="import" href="../bower_components/paper-button/paper-button.html"> |
<polymer-element name="ct-commit-list" attributes="first last commits" noscript> |
<template> |
@@ -12,10 +13,43 @@ found in the LICENSE file. |
:host { |
display: block; |
} |
+ paper-button[repository] { |
+ margin: .5em; |
+ text-transform: lowercase; |
+ } |
+ .repository-info { |
+ display: block; |
+ } |
+ commit-list { |
+ display: block; |
+ padding-left: 1em; |
+ padding-right: 1em; |
+ } |
+ .toggle { |
+ text-decoration: underline; |
+ color: -webkit-link; |
+ } |
+ .toggle > core-icon { |
+ color: black; |
+ } |
</style> |
<template repeat="{{ repository in commits.commits | _repositories }}"> |
- <template repeat="{{ commit in repository | _commits }}"> |
- <ct-commit data="{{ commit }}"></ct-commit> |
+ <template if="{{ !_repositoryEmpty(repository) }}"> |
+ <div class="repository-info"> |
+ <div class="toggle" on-click="{{ _toggleRepository }}" |
+ repository="{{ repository + _range(repository) }}"> |
+ {{ repository }} {{ _range(repository) }} |
+ <core-icon icon="arrow-drop-down"></core-icon> |
ojan
2014/08/12 01:44:23
My previous advice turned out to be wrong I think.
dsinclair
2014/08/15 14:40:05
Done.
|
+ </div> |
+ |
+ <template if="{{ repositoryVisible[repository + _range(repository)] }}"> |
+ <commit-list> |
+ <template repeat="{{ commit in repository | _commits }}"> |
+ <ct-commit data="{{ commit }}"></ct-commit> |
+ </template> |
+ </commit-list> |
+ </template> |
+ </div> |
</template> |
</template> |
</template> |
@@ -24,6 +58,11 @@ found in the LICENSE file. |
commits: null, |
first: null, |
last: null, |
+ repositoryVisible: undefined, |
+ |
+ created: function() { |
+ this.repositoryVisible = {}; |
+ }, |
_repositories: function(commits) { |
if (!commits) |
@@ -48,6 +87,22 @@ found in the LICENSE file. |
return this.commits.range(repository, first + 1, last); |
}, |
+ |
+ _repositoryEmpty: function(repository) { |
+ return this._commits(repository).length === 0; |
+ }, |
+ |
+ _range: function(repository) { |
+ var commits = this._commits(repository); |
+ if (commits.length === 0) |
+ return ""; |
+ return commits.first().revision + " : " + commits.last().revision; |
+ }, |
+ |
+ _toggleRepository: function(event, detail, sender, target) { |
ojan
2014/08/12 01:44:23
I was picturing that this would work more like htt
|
+ var repoName = sender.getAttribute('repository'); |
+ this.repositoryVisible[repoName] = !this.repositoryVisible[repoName]; |
+ } |
}); |
</script> |
</polymer-element> |