summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-09-15 06:58:49 -0700
committerStan Hu <stanhu@gmail.com>2015-09-15 13:07:32 -0700
commitd9af6f79ed439308d13f44a0cfade6a355607f14 (patch)
tree99ea6028fee1cf0b506fc9aacd810daa1ad1b326 /app/controllers
parent0a8ef29b3d2504ba66cd0a98992c1f5f70b11daa (diff)
downloadgitlab-ce-d9af6f79ed439308d13f44a0cfade6a355607f14.tar.gz
Change the replace placeholder to use the filenamefix-upload-ui
Dynamically adjust placedholder for uploads and fix Dropzone event handlers Override error handler to prevent error messages from being inserted underneath image preview Fix tests Use regexp instead of startsWith for better browser compatibility Remove duplicate code in _replace.html.haml and use one template Remove files upon error and retain alert messages until user adds a new file
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/blob_controller.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index 8776721d243..d7be212c33a 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -18,6 +18,12 @@ class Projects::BlobController < Projects::ApplicationController
before_action :after_edit_path, only: [:edit, :update]
def new
+ @title = 'Upload'
+ @placeholder = 'Upload new file'
+ @button_title = 'Upload file'
+ @form_path = namespace_project_create_blob_path(@project.namespace, @project, @id)
+ @method = :post
+
commit unless @repository.empty?
end
@@ -40,6 +46,11 @@ class Projects::BlobController < Projects::ApplicationController
end
def show
+ @title = "Replace #{@blob.name}"
+ @placeholder = @title
+ @button_title = 'Replace file'
+ @form_path = namespace_project_update_blob_path(@project.namespace, @project, @id)
+ @method = :put
end
def edit