Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1945)

Unified Diff: Tools/GardeningServer/ui/ct-commit-list.html

Issue 441393002: Collapse commit list by default in sheriff-o-matic. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698