From 51c9f8b6d681412166aaefccd36c589401ed89b5 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 19 Sep 2017 16:38:55 +0100 Subject: [ci skip] First iteration: port haml into vue --- .../projects/registry/repositories/index.html.haml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index 5661af01302..ab263091c1f 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -52,9 +52,15 @@ #{escape_once(@project.container_registry_url)}/optional-image-name:tag #{escape_once(@project.container_registry_url)}/optional-name/optional-image-name:tag - - if @images.blank? - %p.settings-message.text-center.append-bottom-default - No container images stored for this project. Add one by following the - instructions above. - - else - = render partial: 'image', collection: @images + #js-vue-registry-images{ data: { endpoint: project_container_registry_index_path(@project, format: :json)}} + + = page_specific_javascript_bundle_tag('common_vue') + = page_specific_javascript_bundle_tag('registry_list') + + + -# - if @images.blank? + -# %p.settings-message.text-center.append-bottom-default + -# No container images stored for this project. Add one by following the + -# instructions above. + -# - else + -# = render partial: 'image', collection: @images -- cgit v1.2.1 From 6c63520ef5735e56749c77b495f8137a20942504 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 19 Sep 2017 17:53:57 +0100 Subject: Removes 2 column layout. Adds i18n support --- .../projects/registry/repositories/index.html.haml | 102 ++++++++++----------- 1 file changed, 47 insertions(+), 55 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index ab263091c1f..4a76431494c 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -1,66 +1,58 @@ - page_title "Container Registry" -.row.prepend-top-default.append-bottom-default - .col-lg-3 - %h4.prepend-top-0 +%section + .settings-header + %h4 = page_title %p - With the Docker Container Registry integrated into GitLab, every project - can have its own space to store its Docker images. + = _('With the Docker Container Registry integrated into GitLab, every project can have its own space to store its Docker images.') %p.append-bottom-0 = succeed '.' do Learn more about - = link_to 'Container Registry', help_page_path('user/project/container_registry'), target: '_blank' + = link_to _('Container Registry'), help_page_path('user/project/container_registry'), target: '_blank' + .row + .col-lg-12 + .panel.panel-default + .panel-heading + %h4.panel-title + = _('How to use the Container Registry') + .panel-body + %p + = _('First log in to GitLab’s Container Registry using your GitLab username and password. If you have') + = link_to _('2FA enabled'), help_page_path('user/profile/account/two_factor_authentication'), target: '_blank' + you need to use a + = succeed ':' do + = link_to _('personal access token'), help_page_path('user/profile/account/two_factor_authentication', anchor: 'personal-access-tokens'), target: '_blank' + %pre + docker login #{Gitlab.config.registry.host_port} + %br + %p + = _("Once you log in, you’re free to create and upload a container image using the common") + %code + = _('build') + = _('and') + %code push + = _('commands:') + %pre + :plain + docker build -t #{escape_once(@project.container_registry_url)} . + docker push #{escape_once(@project.container_registry_url)} - .col-lg-9 - .panel.panel-default - .panel-heading - %h4.panel-title - How to use the Container Registry - .panel-body - %p - First log in to GitLab’s Container Registry using your GitLab username - and password. If you have - = link_to '2FA enabled', help_page_path('user/profile/account/two_factor_authentication'), target: '_blank' - you need to use a - = succeed ':' do - = link_to 'personal access token', help_page_path('user/profile/account/two_factor_authentication', anchor: 'personal-access-tokens'), target: '_blank' - %pre - docker login #{Gitlab.config.registry.host_port} - %br - %p - Once you log in, you’re free to create and upload a container image - using the common - %code build - and - %code push - commands: - %pre - :plain - docker build -t #{escape_once(@project.container_registry_url)} . - docker push #{escape_once(@project.container_registry_url)} + %hr + %h5.prepend-top-default + = _('Use different image names') + %p.light + = _('GitLab supports up to 3 levels of image names. The following examples of images are valid for your project:') + %pre + :plain + #{escape_once(@project.container_registry_url)}:tag + #{escape_once(@project.container_registry_url)}/optional-image-name:tag + #{escape_once(@project.container_registry_url)}/optional-name/optional-image-name:tag - %hr - %h5.prepend-top-default - Use different image names - %p.light - GitLab supports up to 3 levels of image names. The following - examples of images are valid for your project: - %pre - :plain - #{escape_once(@project.container_registry_url)}:tag - #{escape_once(@project.container_registry_url)}/optional-image-name:tag - #{escape_once(@project.container_registry_url)}/optional-name/optional-image-name:tag - #js-vue-registry-images{ data: { endpoint: project_container_registry_index_path(@project, format: :json)}} + .row + .col-lg-12 + #js-vue-registry-images{ data: { endpoint: project_container_registry_index_path(@project, format: :json)}} - = page_specific_javascript_bundle_tag('common_vue') - = page_specific_javascript_bundle_tag('registry_list') - - - -# - if @images.blank? - -# %p.settings-message.text-center.append-bottom-default - -# No container images stored for this project. Add one by following the - -# instructions above. - -# - else - -# = render partial: 'image', collection: @images + = page_specific_javascript_bundle_tag('common_vue') + = page_specific_javascript_bundle_tag('registry_list') -- cgit v1.2.1 From ee3cf5d6f3d5a3631fa7e94a242f2dfe9b38a935 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Wed, 20 Sep 2017 19:03:53 +0100 Subject: [ci skip] Adds tests to vuex and collapsibe component Formats dates Fixes clipboard button Simplifies HTML --- app/views/projects/registry/repositories/index.html.haml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index 4a76431494c..9bf5eb03cb0 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -8,7 +8,7 @@ = _('With the Docker Container Registry integrated into GitLab, every project can have its own space to store its Docker images.') %p.append-bottom-0 = succeed '.' do - Learn more about + = _('Learn more about') = link_to _('Container Registry'), help_page_path('user/project/container_registry'), target: '_blank' .row .col-lg-12 @@ -20,14 +20,14 @@ %p = _('First log in to GitLab’s Container Registry using your GitLab username and password. If you have') = link_to _('2FA enabled'), help_page_path('user/profile/account/two_factor_authentication'), target: '_blank' - you need to use a + = _('you need to use a') = succeed ':' do = link_to _('personal access token'), help_page_path('user/profile/account/two_factor_authentication', anchor: 'personal-access-tokens'), target: '_blank' %pre docker login #{Gitlab.config.registry.host_port} %br %p - = _("Once you log in, you’re free to create and upload a container image using the common") + = _('Once you log in, you’re free to create and upload a container image using the common') %code = _('build') = _('and') @@ -37,7 +37,6 @@ :plain docker build -t #{escape_once(@project.container_registry_url)} . docker push #{escape_once(@project.container_registry_url)} - %hr %h5.prepend-top-default = _('Use different image names') @@ -48,8 +47,6 @@ #{escape_once(@project.container_registry_url)}:tag #{escape_once(@project.container_registry_url)}/optional-image-name:tag #{escape_once(@project.container_registry_url)}/optional-name/optional-image-name:tag - - .row .col-lg-12 #js-vue-registry-images{ data: { endpoint: project_container_registry_index_path(@project, format: :json)}} -- cgit v1.2.1 From d0e5bafa305b7bb481cb3fe527bbbc0f5b09ade3 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 22 Sep 2017 11:46:55 +0100 Subject: Adds pagination Adds specs --- app/views/projects/registry/repositories/index.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index 9bf5eb03cb0..ca78ecf1226 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -18,7 +18,7 @@ = _('How to use the Container Registry') .panel-body %p - = _('First log in to GitLab’s Container Registry using your GitLab username and password. If you have') + = _('First log in to GitLab’s Container Registry using your GitLab username and password. If you have').html_safe = link_to _('2FA enabled'), help_page_path('user/profile/account/two_factor_authentication'), target: '_blank' = _('you need to use a') = succeed ':' do @@ -27,7 +27,7 @@ docker login #{Gitlab.config.registry.host_port} %br %p - = _('Once you log in, you’re free to create and upload a container image using the common') + = _('Once you log in, you’re free to create and upload a container image using the common').html_safe %code = _('build') = _('and') -- cgit v1.2.1 From a4a6b0f50eecc278d00093dad109424fa63db675 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 22 Sep 2017 12:18:44 +0100 Subject: Removes unused file --- .../registry/repositories/_image.html.haml | 32 ---------------------- 1 file changed, 32 deletions(-) delete mode 100644 app/views/projects/registry/repositories/_image.html.haml (limited to 'app/views') diff --git a/app/views/projects/registry/repositories/_image.html.haml b/app/views/projects/registry/repositories/_image.html.haml deleted file mode 100644 index a0535edafc3..00000000000 --- a/app/views/projects/registry/repositories/_image.html.haml +++ /dev/null @@ -1,32 +0,0 @@ -.container-image.js-toggle-container - .container-image-head - = link_to "#", class: "js-toggle-button" do - = icon('chevron-down', 'aria-hidden': 'true') - = escape_once(image.path) - - = clipboard_button(clipboard_text: "docker pull #{image.location}") - - - if can?(current_user, :update_container_image, @project) - .controls.hidden-xs.pull-right - = link_to project_container_registry_path(@project, image), - class: 'btn btn-remove has-tooltip', - title: 'Remove repository', - data: { confirm: 'Are you sure?' }, - method: :delete do - = icon('trash cred', 'aria-hidden': 'true') - - .container-image-tags.js-toggle-content.hide - - if image.has_tags? - .table-holder - %table.table.tags - %thead - %tr - %th Tag - %th Tag ID - %th Size - %th Created - - if can?(current_user, :update_container_image, @project) - %th - = render partial: 'tag', collection: image.tags - - else - .nothing-here-block No tags in Container Registry for this container image. -- cgit v1.2.1 From b187426720068903184ca33a63f9dfe22c29f49a Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 22 Sep 2017 19:12:06 +0100 Subject: Change layout order --- app/views/projects/registry/repositories/index.html.haml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index ca78ecf1226..f201fd44bc9 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -10,7 +10,14 @@ = succeed '.' do = _('Learn more about') = link_to _('Container Registry'), help_page_path('user/project/container_registry'), target: '_blank' - .row + .row.registry-placeholder.prepend-bottom-10 + .col-lg-12 + #js-vue-registry-images{ data: { endpoint: project_container_registry_index_path(@project, format: :json) } } + + = page_specific_javascript_bundle_tag('common_vue') + = page_specific_javascript_bundle_tag('registry_list') + + .row.prepend-top-10 .col-lg-12 .panel.panel-default .panel-heading @@ -47,9 +54,3 @@ #{escape_once(@project.container_registry_url)}:tag #{escape_once(@project.container_registry_url)}/optional-image-name:tag #{escape_once(@project.container_registry_url)}/optional-name/optional-image-name:tag - .row - .col-lg-12 - #js-vue-registry-images{ data: { endpoint: project_container_registry_index_path(@project, format: :json)}} - - = page_specific_javascript_bundle_tag('common_vue') - = page_specific_javascript_bundle_tag('registry_list') -- cgit v1.2.1 From 84c4834fb430e78e605519b53bd9aff25cb6426a Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Mon, 25 Sep 2017 12:29:55 +0100 Subject: Changes after review --- app/views/projects/registry/repositories/index.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index f201fd44bc9..12a5778fed8 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -5,10 +5,10 @@ %h4 = page_title %p - = _('With the Docker Container Registry integrated into GitLab, every project can have its own space to store its Docker images.') + = s_('ContainerRegistry|With the Docker Container Registry integrated into GitLab, every project can have its own space to store its Docker images.') %p.append-bottom-0 = succeed '.' do - = _('Learn more about') + = s_('ContainerRegistry|Learn more about') = link_to _('Container Registry'), help_page_path('user/project/container_registry'), target: '_blank' .row.registry-placeholder.prepend-bottom-10 .col-lg-12 @@ -22,7 +22,7 @@ .panel.panel-default .panel-heading %h4.panel-title - = _('How to use the Container Registry') + = s_('ContainerRegistry|How to use the Container Registry') .panel-body %p = _('First log in to GitLab’s Container Registry using your GitLab username and password. If you have').html_safe -- cgit v1.2.1 From 5ae54ca3eb98df665a243bf190a16e80e87c37f2 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Mon, 25 Sep 2017 18:00:39 +0100 Subject: Moves table component into a separate one Adds better support for i18n --- .../projects/registry/repositories/index.html.haml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index 12a5778fed8..36ea5e013e4 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -25,30 +25,23 @@ = s_('ContainerRegistry|How to use the Container Registry') .panel-body %p - = _('First log in to GitLab’s Container Registry using your GitLab username and password. If you have').html_safe - = link_to _('2FA enabled'), help_page_path('user/profile/account/two_factor_authentication'), target: '_blank' - = _('you need to use a') - = succeed ':' do - = link_to _('personal access token'), help_page_path('user/profile/account/two_factor_authentication', anchor: 'personal-access-tokens'), target: '_blank' + - link_token = link_to(_('personal access token'), help_page_path('user/profile/account/two_factor_authentication', anchor: 'personal-access-tokens'), target: '_blank') + - link_2fa = link_to(_('2FA enabled'), help_page_path('user/profile/account/two_factor_authentication'), target: '_blank') + = s_('ContainerRegistry|First log in to GitLab’s Container Registry using your GitLab username and password. If you have %{link_2fa} you need to use a %{link_token}:').html_safe % { link_2fa: link_2fa, link_token: link_token } %pre docker login #{Gitlab.config.registry.host_port} %br %p - = _('Once you log in, you’re free to create and upload a container image using the common').html_safe - %code - = _('build') - = _('and') - %code push - = _('commands:') + = s_('ContainerRegistry|Once you log in, you’re free to create and upload a container image using the common %{build} and %{push} commands').html_safe % { build: "build".html_safe, push: "push".html_safe } %pre :plain docker build -t #{escape_once(@project.container_registry_url)} . docker push #{escape_once(@project.container_registry_url)} %hr %h5.prepend-top-default - = _('Use different image names') + = s_('ContainerRegistry|Use different image names') %p.light - = _('GitLab supports up to 3 levels of image names. The following examples of images are valid for your project:') + = s_('ContainerRegistry|GitLab supports up to 3 levels of image names. The following examples of images are valid for your project:') %pre :plain #{escape_once(@project.container_registry_url)}:tag -- cgit v1.2.1