diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/project_new.js | 13 | ||||
-rw-r--r-- | app/views/projects/edit.html.haml | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/app/assets/javascripts/project_new.js b/app/assets/javascripts/project_new.js index 40575caa57f..0d3fb31a9cf 100644 --- a/app/assets/javascripts/project_new.js +++ b/app/assets/javascripts/project_new.js @@ -45,7 +45,9 @@ }; ProjectNew.prototype.toggleRepoVisibility = function () { - var $repoAccessLevel = $('.js-repo-access-level select'); + var $repoAccessLevel = $('.js-repo-access-level select'), + containerRegistry = document.querySelectorAll('.js-container-registry')[0], + containerRegistryCheckbox = document.getElementById('project_container_registry_enabled'); this.$repoSelects.find("option[value='" + $repoAccessLevel.val() + "']") .nextAll() @@ -70,8 +72,17 @@ if (selectedVal) { this.$repoSelects.removeClass('disabled'); + + if (containerRegistry) { + containerRegistry.style.display = ''; + } } else { this.$repoSelects.addClass('disabled'); + + if (containerRegistry) { + containerRegistry.style.display = 'none'; + containerRegistryCheckbox.checked = false; + } } }.bind(this)); }; diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index c40ad06969e..a5422966617 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -102,7 +102,7 @@ = link_to icon('question-circle'), help_page_path('workflow/lfs/manage_large_binaries_with_git_lfs') - if Gitlab.config.registry.enabled - .form-group + .form-group.js-container-registry{ style: ("display: none;" if @project.project_feature.send(:repository_access_level) == 0) } .checkbox = f.label :container_registry_enabled do = f.check_box :container_registry_enabled @@ -290,4 +290,4 @@ Saving project. %p Please wait a moment, this page will automatically refresh when ready. -= render 'shared/confirm_modal', phrase: @project.path
\ No newline at end of file += render 'shared/confirm_modal', phrase: @project.path |