From edf2060c6d91db079e30ed56178be2eabc352132 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 20 Mar 2018 17:00:56 +0000 Subject: [PATCH] fixed ide_edit_button not existing --- app/helpers/blob_helper.rb | 11 +++++++++++ app/views/projects/blob/_header.html.haml | 1 + 2 files changed, 12 insertions(+) diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 5ff09b23a78..2b440e4d584 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -33,6 +33,17 @@ module BlobHelper ref) end + def ide_edit_button(project = @project, ref = @ref, path = @path, options = {}) + return unless blob = readable_blob(options, path, project, ref) + + edit_button_tag(blob, + 'btn btn-default', + _('Web IDE'), + ide_edit_path(project, ref, path, options), + project, + ref) + end + def modify_file_button(project = @project, ref = @ref, path = @path, label:, action:, btn_class:, modal_type:) return unless current_user diff --git a/app/views/projects/blob/_header.html.haml b/app/views/projects/blob/_header.html.haml index f93bb02acb9..1b150ec3e5c 100644 --- a/app/views/projects/blob/_header.html.haml +++ b/app/views/projects/blob/_header.html.haml @@ -12,6 +12,7 @@ .btn-group{ role: "group" }< = edit_blob_button + = ide_edit_button - if current_user = replace_blob_link = delete_blob_link