BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9cf6d451
Commit
9cf6d451
authored
Aug 19, 2016
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move editor paths to helper
parent
8db088cc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
blob_helper.rb
app/helpers/blob_helper.rb
+8
-0
edit.html.haml
app/views/projects/blob/edit.html.haml
+1
-1
new.html.haml
app/views/projects/blob/new.html.haml
+1
-1
No files found.
app/helpers/blob_helper.rb
View file @
9cf6d451
...
...
@@ -217,4 +217,12 @@ module BlobHelper
def
gitlab_ci_ymls
@gitlab_ci_ymls
||=
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
dropdown_names
end
def
blob_editor_paths
{
'relative-url-root'
=>
Rails
.
application
.
config
.
relative_url_root
,
'assets-prefix'
=>
Gitlab
::
Application
.
config
.
assets
.
prefix
,
'blob-language'
=>
@blob
&&
@blob
.
language
.
try
(
:ace_mode
)
}
end
end
app/views/projects/blob/edit.html.haml
View file @
9cf6d451
...
...
@@ -19,7 +19,7 @@
=
link_to
'#preview'
,
'data-preview-url'
=>
namespace_project_preview_blob_path
(
@project
.
namespace
,
@project
,
@id
)
do
=
editing_preview_title
(
@blob
.
name
)
=
form_tag
(
namespace_project_update_blob_path
(
@project
.
namespace
,
@project
,
@id
),
method: :put
,
class:
'form-horizontal js-quick-submit js-requires-input js-edit-blob-form'
,
data:
{
'relative-url-root'
=>
"
#{
Rails
.
application
.
config
.
relative_url_root
}
"
,
'assets-prefix'
=>
"
#{
Gitlab
::
Application
.
config
.
assets
.
prefix
}
"
,
'blob-language'
=>
"
#{
@blob
.
language
.
try
(
:ace_mode
)
}
"
}
)
do
=
form_tag
(
namespace_project_update_blob_path
(
@project
.
namespace
,
@project
,
@id
),
method: :put
,
class:
'form-horizontal js-quick-submit js-requires-input js-edit-blob-form'
,
data:
blob_editor_paths
)
do
=
render
'projects/blob/editor'
,
ref:
@ref
,
path:
@path
,
blob_data:
@blob
.
data
=
render
'shared/new_commit_form'
,
placeholder:
"Update
#{
@blob
.
name
}
"
=
hidden_field_tag
'last_commit_sha'
,
@last_commit_sha
...
...
app/views/projects/blob/new.html.haml
View file @
9cf6d451
...
...
@@ -7,7 +7,7 @@
New File
.file-editor
=
form_tag
(
namespace_project_create_blob_path
(
@project
.
namespace
,
@project
,
@id
),
method: :post
,
class:
'form-horizontal js-edit-blob-form js-new-blob-form js-quick-submit js-requires-input'
,
data:
{
'relative-url-root'
=>
"
#{
Rails
.
application
.
config
.
relative_url_root
}
"
,
'assets-prefix'
=>
"
#{
Gitlab
::
Application
.
config
.
assets
.
prefix
}
"
}
)
do
=
form_tag
(
namespace_project_create_blob_path
(
@project
.
namespace
,
@project
,
@id
),
method: :post
,
class:
'form-horizontal js-edit-blob-form js-new-blob-form js-quick-submit js-requires-input'
,
data:
blob_editor_paths
)
do
=
render
'projects/blob/editor'
,
ref:
@ref
=
render
'shared/new_commit_form'
,
placeholder:
"Add new file"
...
...
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