Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
ac855e5e
Commit
ac855e5e
authored
Sep 16, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move partial locals out of controller
parent
b75e4d71
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
18 deletions
+11
-18
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+0
-11
app/views/projects/blob/_upload.html.haml
app/views/projects/blob/_upload.html.haml
+5
-5
app/views/projects/blob/new.html.haml
app/views/projects/blob/new.html.haml
+1
-1
app/views/projects/blob/show.html.haml
app/views/projects/blob/show.html.haml
+5
-1
No files found.
app/controllers/projects/blob_controller.rb
View file @
ac855e5e
...
...
@@ -18,12 +18,6 @@ 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
...
...
@@ -46,11 +40,6 @@ 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
...
...
app/views/projects/blob/_upload.html.haml
View file @
ac855e5e
...
...
@@ -3,12 +3,12 @@
.modal-content
.modal-header
%a
.close
{
href:
"#"
,
"data-dismiss"
=>
"modal"
}
×
%h3
.page-title
#{
@
title
}
%h3
.page-title
#{
title
}
%p
.light
From branch
%strong
=
@ref
.modal-body
=
form_tag
@form_path
,
method:
@
method
,
class:
'blob-file-upload-form-js form-horizontal'
do
=
form_tag
form_path
,
method:
method
,
class:
'blob-file-upload-form-js form-horizontal'
do
.dropzone
.dropzone-previews.blob-upload-dropzone-previews
%p
.dz-message.light
...
...
@@ -17,12 +17,12 @@
%br
.dropzone-alerts
{
class:
"alert alert-danger data"
,
style:
"display:none"
}
=
render
'shared/commit_message_container'
,
params:
params
,
placeholder:
@
placeholder
placeholder:
placeholder
.form-group
.col-sm-offset-2.col-sm-10
=
button_tag
@
button_title
,
class:
'btn btn-small btn-primary btn-upload-file'
,
id:
'submit-all'
=
button_tag
button_title
,
class:
'btn btn-small btn-primary btn-upload-file'
,
id:
'submit-all'
=
link_to
"Cancel"
,
'#'
,
class:
"btn btn-cancel"
,
"data-dismiss"
=>
"modal"
:coffeescript
disableButtonIfEmptyField $('.blob-file-upload-form-js').find('#commit_message'), '.btn-upload-file'
new BlobFileDropzone($('.blob-file-upload-form-js'), '
#{
@
method
}
')
new BlobFileDropzone($('.blob-file-upload-form-js'), '
#{
method
}
')
app/views/projects/blob/new.html.haml
View file @
ac855e5e
...
...
@@ -4,7 +4,7 @@
{
class:
'upload-link'
,
'data-target'
=>
'#modal-upload-blob'
,
'data-toggle'
=>
'modal'
}
an existing one
=
render
'projects/blob/upload'
=
render
'projects/blob/upload'
,
title:
'Upload'
,
placeholder:
'Upload new file'
,
button_title:
'Upload file'
,
form_path:
namespace_project_create_blob_path
(
@project
.
namespace
,
@project
,
@id
),
method: :post
.file-editor
=
form_tag
(
namespace_project_create_blob_path
(
@project
.
namespace
,
@project
,
@id
),
method: :post
,
class:
'form-horizontal form-new-file js-requires-input'
)
do
...
...
app/views/projects/blob/show.html.haml
View file @
ac855e5e
...
...
@@ -10,4 +10,8 @@
-
if
allowed_tree_edit?
=
render
'projects/blob/remove'
=
render
'projects/blob/upload'
-
title
=
"Replace
#{
@blob
.
name
}
"
=
render
'projects/blob/upload'
,
title:
title
,
placeholder:
title
,
button_title:
'Replace file'
,
form_path:
namespace_project_update_blob_path
(
@project
.
namespace
,
@project
,
@id
),
method: :put
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment