aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2018-04-03 23:19:46 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:53 +1200
commita6aaa5c8efef3009086032c7e54a519714940a1b (patch)
tree52c80530a90ddbc8e2f99ab89b1720cf18f5c775 /templates
parentc78fbde643d46f8ed9acbb36ab091234581fb2e0 (diff)
downloadopenembedded-core-contrib-a6aaa5c8efef3009086032c7e54a519714940a1b.tar.gz
Implement layer web repo commit URL
The Recipe Reporting System needs to be able to provide links to commits in the web interface for the repository, but we can only do this if we have a custom template URL just like we do for file/tree links, since it's different for different git web interfaces. Add support in all the various places for such a URL and make use of it in the RRS. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/layerindex/editlayer.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/templates/layerindex/editlayer.html b/templates/layerindex/editlayer.html
index e2350808f2..ce7b292f76 100644
--- a/templates/layerindex/editlayer.html
+++ b/templates/layerindex/editlayer.html
@@ -196,6 +196,7 @@
this.vcs_web_url = 'http://cgit.openembedded.org/' + reponame
this.vcs_web_tree_base_url = 'http://cgit.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
this.vcs_web_file_base_url = 'http://cgit.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
+ this.vcs_web_commit_url = 'http://cgit.openembedded.org/' + reponame + '/commit/?id=%hash%'
this.vcs_web_type = 'cgit'
}
else if( repoval.indexOf('git.yoctoproject.org/') > -1 ) {
@@ -203,6 +204,7 @@
this.vcs_web_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame
this.vcs_web_tree_base_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/tree/%path%?h=%branch%'
this.vcs_web_file_base_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/tree/%path%?h=%branch%'
+ this.vcs_web_commit_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/commit/?id=%hash%'
this.vcs_web_type = 'cgit'
}
else if( repoval.indexOf('github.com/') > -1 ) {
@@ -211,6 +213,7 @@
this.vcs_web_url = 'http://github.com/' + reponame
this.vcs_web_tree_base_url = 'http://github.com/' + reponame + '/tree/%branch%/'
this.vcs_web_file_base_url = 'http://github.com/' + reponame + '/blob/%branch%/'
+ this.vcs_web_commit_url = 'http://github.com/' + reponame + '/commit/%hash%/'
this.vcs_web_type = '(custom)'
}
else if( repoval.indexOf('bitbucket.org/') > -1 ) {
@@ -219,12 +222,14 @@
this.vcs_web_url = 'http://bitbucket.org/' + reponame
this.vcs_web_tree_base_url = 'http://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
this.vcs_web_file_base_url = 'http://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
+ this.vcs_web_commit_url = 'http://bitbucket.org/' + reponame + '/commits/%hash%'
this.vcs_web_type = '(custom)'
}
else {
this.vcs_web_url = ''
this.vcs_web_tree_base_url = ''
this.vcs_web_file_base_url = ''
+ this.vcs_web_commit_url = ''
this.vcs_web_type = '(custom)'
}
};
@@ -249,10 +254,12 @@
readonly = $('#idx_vcs_web_type').prop('disabled')
$('#id_vcs_web_tree_base_url').prop('readonly', readonly)
$('#id_vcs_web_file_base_url').prop('readonly', readonly)
+ $('#id_vcs_web_commit_url').prop('readonly', readonly)
}
else {
$('#id_vcs_web_tree_base_url').prop('readonly', true)
$('#id_vcs_web_file_base_url').prop('readonly', true)
+ $('#id_vcs_web_commit_url').prop('readonly', true)
vcs_web_url = $('#id_vcs_web_url').val()
if (vcs_web_url) {
if (vcs_web_url.endsWith('/')) {
@@ -261,14 +268,17 @@
if (type == 'cgit') {
$('#id_vcs_web_tree_base_url').val('readonly', true)
$('#id_vcs_web_file_base_url').prop('readonly', true)
+ $('#id_vcs_web_commit_url').prop('readonly', true)
if (e) {
$('#id_vcs_web_tree_base_url').val(vcs_web_url + '/tree/%path%?h=%branch%')
$('#id_vcs_web_file_base_url').val(vcs_web_url + '/tree/%path%?h=%branch%')
+ $('#id_vcs_web_commit_url').val(vcs_web_url + '/commit/id=%hash%')
}
}
else if (type == 'gitweb') {
$('#id_vcs_web_tree_base_url').val('readonly', true)
$('#id_vcs_web_file_base_url').prop('readonly', true)
+ $('#id_vcs_web_commit_url').prop('readonly', true)
if (e) {
spliturl = vcs_web_url.split('?')
if (spliturl.length > 1) {
@@ -290,14 +300,17 @@
}
$('#id_vcs_web_tree_base_url').val(vcs_web_url + 'a=tree;f=%path%;hb=refs/heads/%branch%')
$('#id_vcs_web_file_base_url').val(vcs_web_url + 'a=blob;f=%path%;hb=refs/heads/%branch%')
+ $('#id_vcs_web_commit_url').val(vcs_web_url + 'a=commit;h=%hash%')
}
}
else if (type == 'gitlab') {
$('#id_vcs_web_tree_base_url').val('readonly', true)
$('#id_vcs_web_file_base_url').prop('readonly', true)
+ $('#id_vcs_web_commit_url').prop('readonly', true)
if (e) {
$('#id_vcs_web_tree_base_url').val(vcs_web_url + '/tree/%branch%/%path%')
$('#id_vcs_web_file_base_url').val(vcs_web_url + '/blob/%branch%/%path%')
+ $('#id_vcs_web_commit_url').val(vcs_web_url + '/commit/%hash%')
}
}
}
@@ -312,6 +325,7 @@
$('#id_vcs_web_url').val(awf.vcs_web_url)
$('#id_vcs_web_tree_base_url').val(awf.vcs_web_tree_base_url)
$('#id_vcs_web_file_base_url').val(awf.vcs_web_file_base_url)
+ $('#id_vcs_web_commit_url').val(awf.vcs_web_commit_url)
$('#idx_vcs_web_type').val(awf.vcs_web_type)
}
$('#id_vcs_web_url').prop('readonly', true);