Merge "PolyGerrit: Add link to project + branch"

This commit is contained in:
Martin Fick
2017-04-04 16:53:08 +00:00
committed by Gerrit Code Review
2 changed files with 15 additions and 1 deletions

View File

@@ -186,7 +186,9 @@ limitations under the License.
</section>
<section>
<span class="title">Branch</span>
<span class="value">[[change.branch]]</span>
<span class="value">
<a href$="[[_computeBranchURL(change.project, change.branch)]]">[[change.branch]]</a>
</span>
</section>
<section>
<span class="title">Topic</span>

View File

@@ -230,6 +230,18 @@
return '/q/status:open+project:' + this.encodeURL(project, false);
},
_computeBranchURL: function(project, branch) {
var status;
if (this.change.status == this.ChangeStatus.NEW) {
status = this.change.status.toLowerCase().replace('new', 'open');
} else {
status = this.change.status.toLowerCase();
}
return '/q/project:' + this.encodeURL(project, false) +
' branch:' + this.encodeURL(branch, false) +
' status:' + this.encodeURL(status, false);
},
_computeTopicHref: function(topic) {
var encodedTopic = encodeURIComponent('\"' + topic + '\"');
return '/q/topic:' + encodeURIComponent(encodedTopic) +