Make the new repo page support all the trigger types automatically.
This commit is contained in:
parent
07b4fb9105
commit
af5fc42f27
2 changed files with 17 additions and 11 deletions
|
@ -19,6 +19,7 @@
|
|||
UserService.updateUserIn($scope);
|
||||
|
||||
$scope.Features = Features;
|
||||
$scope.TriggerService = TriggerService;
|
||||
|
||||
$scope.repo = {
|
||||
'is_public': 0,
|
||||
|
@ -95,9 +96,10 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// Conduct the Github redirect if applicable.
|
||||
if ($scope.repo.initialize == 'github') {
|
||||
window.location = TriggerService.getRedirectUrl('github', repo.namespace, repo.name);
|
||||
// Conduct the SCM redirect if applicable.
|
||||
var redirectUrl = TriggerService.getRedirectUrl($scope.repo.initialize, repo.namespace, repo.name);
|
||||
if (redirectUrl) {
|
||||
window.location = redirectUrl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -137,11 +137,14 @@
|
|||
<label for="initDockerfile">Initialize from a <b>Dockerfile</b></label>
|
||||
</div>
|
||||
|
||||
<!-- Github -->
|
||||
<div class="repo-option" ng-show="Features.GITHUB_BUILD">
|
||||
<input type="radio" id="initGithub" name="initialize" ng-model="repo.initialize" value="github">
|
||||
<i class="fa fa-github fa-lg" style="padding: 6px; padding-left: 10px; padding-right: 12px;"></i>
|
||||
<label for="initGithub">Link to a GitHub Repository</label>
|
||||
<!-- SCM -->
|
||||
<div class="repo-option"
|
||||
ng-repeat="type in TriggerService.getTypes()"
|
||||
ng-if="TriggerService.isEnabled(type)">
|
||||
<input type="radio" id="init{{type}}" name="initialize" ng-model="repo.initialize" value="{{ type }}">
|
||||
<i class="fa fa-lg" ng-class="TriggerService.getIcon(type)"
|
||||
style="padding: 6px; padding-left: 10px; padding-right: 12px;"></i>
|
||||
<label for="init{{type}}">Link to a {{ TriggerService.getTitle(type) }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -167,11 +170,12 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="repo.initialize == 'github'">
|
||||
|
||||
<div class="row"
|
||||
ng-repeat="type in TriggerService.getTypes()"
|
||||
ng-if="TriggerService.isEnabled(type) && repo.initialize == type">
|
||||
<div class="col-md-12">
|
||||
<div class="co-alert co-alert-info">
|
||||
You will be redirected to authorize via GitHub once the repository has been created
|
||||
You will be redirected to authorize for {{ TriggerService.getTitle(type) }} once the repository has been created
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in a new issue