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
Boxiang Sun
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+8
-0
app/views/projects/blob/edit.html.haml
app/views/projects/blob/edit.html.haml
+1
-1
app/views/projects/blob/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
...
@@ -217,4 +217,12 @@ module BlobHelper
def
gitlab_ci_ymls
def
gitlab_ci_ymls
@gitlab_ci_ymls
||=
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
dropdown_names
@gitlab_ci_ymls
||=
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
dropdown_names
end
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
end
app/views/projects/blob/edit.html.haml
View file @
9cf6d451
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
=
link_to
'#preview'
,
'data-preview-url'
=>
namespace_project_preview_blob_path
(
@project
.
namespace
,
@project
,
@id
)
do
=
link_to
'#preview'
,
'data-preview-url'
=>
namespace_project_preview_blob_path
(
@project
.
namespace
,
@project
,
@id
)
do
=
editing_preview_title
(
@blob
.
name
)
=
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
'projects/blob/editor'
,
ref:
@ref
,
path:
@path
,
blob_data:
@blob
.
data
=
render
'shared/new_commit_form'
,
placeholder:
"Update
#{
@blob
.
name
}
"
=
render
'shared/new_commit_form'
,
placeholder:
"Update
#{
@blob
.
name
}
"
=
hidden_field_tag
'last_commit_sha'
,
@last_commit_sha
=
hidden_field_tag
'last_commit_sha'
,
@last_commit_sha
...
...
app/views/projects/blob/new.html.haml
View file @
9cf6d451
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
New File
New File
.file-editor
.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
'projects/blob/editor'
,
ref:
@ref
=
render
'shared/new_commit_form'
,
placeholder:
"Add new file"
=
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