diff options
author | Vinnie Okada <vokada@mrvinn.com> | 2015-01-24 11:02:58 -0700 |
---|---|---|
committer | Vinnie Okada <vokada@mrvinn.com> | 2015-02-14 11:09:23 -0700 |
commit | 76aad9b76ed756ca9ba2cbcdb399c815e542b3ae (patch) | |
tree | 7226e0ce64796abbf4848582baed8d173ddecd14 /app/views/projects/blob | |
parent | 5725b6daad2f403f13112cfcafa5b45ac126c0ca (diff) | |
download | gitlab-ce-76aad9b76ed756ca9ba2cbcdb399c815e542b3ae.tar.gz |
Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:
* Use nested resources to avoid slashes in arguments to path helpers.
Diffstat (limited to 'app/views/projects/blob')
-rw-r--r-- | app/views/projects/blob/_actions.html.haml | 12 | ||||
-rw-r--r-- | app/views/projects/blob/_blob.html.haml | 6 | ||||
-rw-r--r-- | app/views/projects/blob/_download.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/blob/_remove.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/blob/edit.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/blob/new.html.haml | 4 |
6 files changed, 15 insertions, 15 deletions
diff --git a/app/views/projects/blob/_actions.html.haml b/app/views/projects/blob/_actions.html.haml index f428ae41ef4..b5b29540bb6 100644 --- a/app/views/projects/blob/_actions.html.haml +++ b/app/views/projects/blob/_actions.html.haml @@ -1,19 +1,19 @@ .btn-group.tree-btn-group = edit_blob_link(@project, @ref, @path) - = link_to 'Raw', project_raw_path(@project, @id), + = link_to 'Raw', namespace_project_raw_path(@project.namespace, @project, @id), class: 'btn btn-small', target: '_blank' -# only show normal/blame view links for text files - if @blob.text? - - if current_page? project_blame_path(@project, @id) - = link_to 'Normal View', project_blob_path(@project, @id), + - if current_page? namespace_project_blame_path(@project.namespace, @project, @id) + = link_to 'Normal View', namespace_project_blob_path(@project.namespace, @project, @id), class: 'btn btn-small' - else - = link_to 'Blame', project_blame_path(@project, @id), + = link_to 'Blame', namespace_project_blame_path(@project.namespace, @project, @id), class: 'btn btn-small' unless @blob.empty? - = link_to 'History', project_commits_path(@project, @id), + = link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id), class: 'btn btn-small' - if @ref != @commit.sha - = link_to 'Permalink', project_blob_path(@project, + = link_to 'Permalink', namespace_project_blob_path(@project.namespace, @project, tree_join(@commit.sha, @path)), class: 'btn btn-small' - if allowed_tree_edit? diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index 68f3b08b8c8..64cc3fad6cf 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -1,17 +1,17 @@ %ul.breadcrumb.repo-breadcrumb %li %i.fa.fa-angle-right - = link_to project_tree_path(@project, @ref) do + = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do = @project.path - tree_breadcrumbs(@tree, 6) do |title, path| %li - if path - if path.end_with?(@path) - = link_to project_blob_path(@project, path) do + = link_to namespace_project_blob_path(@project.namespace, @project, path) do %strong = truncate(title, length: 40) - else - = link_to truncate(title, length: 40), project_tree_path(@project, path) + = link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path) - else = link_to title, '#' diff --git a/app/views/projects/blob/_download.html.haml b/app/views/projects/blob/_download.html.haml index c24eeea4931..f2c5e95ecf4 100644 --- a/app/views/projects/blob/_download.html.haml +++ b/app/views/projects/blob/_download.html.haml @@ -1,6 +1,6 @@ .file-content.blob_file.blob-no-preview .center - = link_to project_raw_path(@project, @id) do + = link_to namespace_project_raw_path(@project.namespace, @project, @id) do %h1.light %i.fa.fa-download %h4 diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml index c5568315cb1..09559a4967b 100644 --- a/app/views/projects/blob/_remove.html.haml +++ b/app/views/projects/blob/_remove.html.haml @@ -9,7 +9,7 @@ %strong= @ref .modal-body - = form_tag project_blob_path(@project, @id), method: :delete, class: 'form-horizontal' do + = form_tag namespace_project_blob_path(@project.namespace, @project, @id), method: :delete, class: 'form-horizontal' do = render 'shared/commit_message_container', params: params, placeholder: 'Removed this file because...' .form-group diff --git a/app/views/projects/blob/edit.html.haml b/app/views/projects/blob/edit.html.haml index b150b639888..6884ad1f2f3 100644 --- a/app/views/projects/blob/edit.html.haml +++ b/app/views/projects/blob/edit.html.haml @@ -6,11 +6,11 @@ Edit file %li - = link_to '#preview', 'data-preview-url' => project_preview_blob_path(@project, @id) do + = link_to '#preview', 'data-preview-url' => namespace_project_preview_blob_path(@project.namespace, @project, @id) do %i.fa.fa-eye = editing_preview_title(@blob.name) - = form_tag(project_update_blob_path(@project, @id), method: :put, class: "form-horizontal") do + = form_tag(namespace_project_update_blob_path(@project.namespace, @project, @id), method: :put, class: "form-horizontal") do = render 'projects/blob/editor', ref: @ref, path: @path, blob_data: @blob.data = render 'shared/commit_message_container', params: params, placeholder: "Update #{@blob.name}" diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml index df6aedbe17d..45865d552ae 100644 --- a/app/views/projects/blob/new.html.haml +++ b/app/views/projects/blob/new.html.haml @@ -1,12 +1,12 @@ %h3.page-title New file .file-editor - = form_tag(project_create_blob_path(@project, @id), method: :post, class: 'form-horizontal form-new-file') do + = form_tag(namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post, class: 'form-horizontal form-new-file') do = render 'projects/blob/editor', ref: @ref = render 'shared/commit_message_container', params: params, placeholder: 'Add new file' = hidden_field_tag 'content', '', id: 'file-content' = render 'projects/commit_button', ref: @ref, - cancel_path: project_tree_path(@project, @id) + cancel_path: namespace_project_tree_path(@project.namespace, @project, @id) :javascript blob = new NewBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", null) |