##// END OF EJS Templates
vcs: Minimal change to expose the shadow repository...
vcs: Minimal change to expose the shadow repository Based on my original research, this was the "minimal" starting point. It shows that three concepts are needed for the "repo_name": * From the security standpoint we think of the shadow repository having the same ACL as the target repository of the pull request. This is because the pull request itself is considered to be a part of the target repository. Out of this thought, the variable "acl_repo_name" is used whenever we want to check permissions or when we need the database configuration of the repository. An alternative name would have been "db_repo_name", but the usage for ACL checking is the most important one. * From the web interaction perspective, we need the URL which was originally used to get to the repository. This is because based on this base URL commands can be identified. Especially for Git this is important, so that the commands are correctly recognized. Since the URL is in the focus, this is called "url_repo_name". * Finally we have to deal with the repository on the file system. This is what the VCS layer deal with normally, so this name is called "vcs_repo_name". The original repository interaction is a special case where all three names are the same. When interacting with a pull request, these three names are typically all different. This change is minimal in a sense that it just makes the interaction with a shadow repository barely work, without checking any special constraints yet. This was the starting point for further work on this topic.

File last commit:

r493:029fd462 default
r887:175782be default
Show More
my_account_repos.html
68 lines | 2.0 KiB | text/html | HtmlLexer
project: added all source files and assets
r1 <div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">${_('Repositories You Own')}</h3>
</div>
<div class="panel-body">
<input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
<div id="repos_list_wrap">
<table id="repo_list_table" class="display"></table>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var get_datatable_count = function(){
var api = $('#repo_list_table').dataTable().api();
$('#repo_count').text(api.page.info().recordsDisplay);
};
// repo list
$('#repo_list_table').DataTable({
data: ${c.data|n},
dom: 'rtp',
pageLength: ${c.visual.admin_grid_items},
order: [[ 0, "asc" ]],
columns: [
{ data: {"_": "name",
"sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" },
{ data: 'menu', className: "quick_repo_menu" },
{ data: {"_": "last_changeset",
"sort": "last_changeset_raw",
"type": Number}, title: "${_('Commit')}", className: "td-hash" },
{ data: {"_": "action",
"sort": "action"}, title: "${_('Action')}", className: "td-action" }
],
language: {
tables: better message when tables are empty #685 #1832
r492 paginate: DEFAULT_GRID_PAGINATION,
tables: adding translation for empty tables #685 #1832
r493 emptyTable: _gettext("No repositories available yet.")
project: added all source files and assets
r1 },
"initComplete": function( settings, json ) {
get_datatable_count();
quick_repo_menu();
}
});
// update the counter when doing search
$('#repo_list_table').on( 'search.dt', function (e,settings) {
get_datatable_count();
});
// filter, filter both grids
$('#q_filter').on( 'keyup', function () {
var repo_api = $('#repo_list_table').dataTable().api();
repo_api
.columns(0)
.search(this.value)
.draw();
});
// refilter table if page load via back button
$("#q_filter").trigger('keyup');
});
</script>