diff options
author | winh <winnie@gitlab.com> | 2017-08-08 20:10:27 +0300 |
---|---|---|
committer | winh <winnie@gitlab.com> | 2017-08-08 20:10:27 +0300 |
commit | 1a06f6b8721fdc8ddf25aedf06543fe63e024216 (patch) | |
tree | 4bdbb67c1725aae967073075e805667e971dc84d | |
parent | 335ee51e5642a7f7e2b3d9d680c573e90011b972 (diff) |
Disable Ajax request for GPG status on repository and search page
-rw-r--r-- | app/helpers/commits_helper.rb | 3 | ||||
-rw-r--r-- | app/views/projects/blob/_blob.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/commits/_commit.html.haml | 7 | ||||
-rw-r--r-- | app/views/projects/commits/_commit_list.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/commits/_commits.html.haml | 2 | ||||
-rw-r--r-- | app/views/search/results/_commit.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/_commit_well.html.haml | 2 |
7 files changed, 11 insertions, 9 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 69220a1c0f6..d61c5f01111 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -19,7 +19,8 @@ module CommitsHelper render 'projects/commits/commit', commit: commit, ref: ref, - project: project + project: project, + load_signature_async: false end # Breadcrumb links for a Project and, if applicable, a tree path diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index 849716a679b..d2f2dd1702b 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -3,7 +3,7 @@ .info-well.hidden-xs .well-segment %ul.blob-commit-info - = render 'projects/commits/commit', commit: @last_commit, project: @project, ref: @ref + = render 'projects/commits/commit', commit: @last_commit, project: @project, ref: @ref, load_signature_async: false = render "projects/blob/auxiliary_viewer", blob: blob diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index e7da47032be..05b48f314cb 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -1,3 +1,4 @@ +- load_signature_async = local_assigns.fetch(:load_signature_async) - ref = local_assigns.fetch(:ref) - if @note_counts - note_count = @note_counts.fetch(commit.id, 0) @@ -40,10 +41,10 @@ - if commit.status(ref) = render_commit_status(commit, ref: ref) - - if request.xhr? - = render partial: 'projects/commit/signature', object: commit.signature - - else + - if load_signature_async = render partial: 'projects/commit/ajax_signature', locals: { commit: commit } + - else + = render partial: 'projects/commit/signature', object: commit.signature = link_to commit.short_id, project_commit_path(project, commit), class: "commit-sha btn btn-transparent" = clipboard_button(text: commit.id, title: _("Copy commit SHA to clipboard")) diff --git a/app/views/projects/commits/_commit_list.html.haml b/app/views/projects/commits/_commit_list.html.haml index 6f5835cb9be..c8de67d7a93 100644 --- a/app/views/projects/commits/_commit_list.html.haml +++ b/app/views/projects/commits/_commit_list.html.haml @@ -11,4 +11,4 @@ %li.warning-row.unstyled #{number_with_delimiter(hidden)} additional commits have been omitted to prevent performance issues. - else - %ul.content-list= render commits, project: @project, ref: @ref + %ul.content-list= render commits, project: @project, ref: @ref, load_signature_async: false diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml index d14897428d0..73b46737e4a 100644 --- a/app/views/projects/commits/_commits.html.haml +++ b/app/views/projects/commits/_commits.html.haml @@ -8,7 +8,7 @@ %li.commits-row{ data: { day: day } } %ul.content-list.commit-list.flex-list - = render partial: 'projects/commits/commit', collection: commits, locals: { project: project, ref: ref } + = render partial: 'projects/commits/commit', collection: commits, locals: { project: project, ref: ref, load_signature_async: !request.xhr? } - if hidden > 0 %li.alert.alert-warning diff --git a/app/views/search/results/_commit.html.haml b/app/views/search/results/_commit.html.haml index f34eaf89027..c3eedeb67bd 100644 --- a/app/views/search/results/_commit.html.haml +++ b/app/views/search/results/_commit.html.haml @@ -1 +1 @@ -= render 'projects/commits/commit', project: @project, commit: commit, ref: nil += render 'projects/commits/commit', project: @project, commit: commit, ref: nil, load_signature_async: false diff --git a/app/views/shared/_commit_well.html.haml b/app/views/shared/_commit_well.html.haml index 50e3d80a84d..56edf53bf95 100644 --- a/app/views/shared/_commit_well.html.haml +++ b/app/views/shared/_commit_well.html.haml @@ -1,4 +1,4 @@ .info-well.hidden-xs.project-last-commit.append-bottom-default .well-segment %ul.blob-commit-info - = render 'projects/commits/commit', commit: commit, ref: ref, project: project + = render 'projects/commits/commit', commit: commit, ref: ref, project: project, load_signature_async: false |