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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
6f78be4d
Commit
6f78be4d
authored
Jan 15, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7951 from cirosantilli/uniform-blob-edit
Make blob new and edit file editors more uniform
parents
c5ba87a2
3a3b0da8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
22 deletions
+17
-22
app/views/projects/_blob_editor.html.haml
app/views/projects/_blob_editor.html.haml
+15
-0
app/views/projects/edit_tree/show.html.haml
app/views/projects/edit_tree/show.html.haml
+1
-16
app/views/projects/new_tree/show.html.haml
app/views/projects/new_tree/show.html.haml
+1
-6
No files found.
app/views/projects/_blob_editor.html.haml
0 → 100644
View file @
6f78be4d
.file-holder.file
.file-title
%i
.icon-file
%span
.file_name
%span
.monospace.light
#{
ref
}
-
if
local_assigns
[
:path
]
=
': '
+
local_assigns
[
:path
]
.file-content.code
%pre
.js-edit-mode-pane
#editor
=
params
[
:content
]
||
local_assigns
[
:blob_data
]
-
if
local_assigns
[
:path
]
.js-edit-mode-pane
#preview
.hide
.center
%h2
%i
.icon-spinner.icon-spin
app/views/projects/edit_tree/show.html.haml
View file @
6f78be4d
...
@@ -6,21 +6,7 @@
...
@@ -6,21 +6,7 @@
=
link_to
editing_preview_title
(
@blob
.
name
),
'#preview'
,
'data-preview-url'
=>
preview_project_edit_tree_path
(
@project
,
@id
)
=
link_to
editing_preview_title
(
@blob
.
name
),
'#preview'
,
'data-preview-url'
=>
preview_project_edit_tree_path
(
@project
,
@id
)
=
form_tag
(
project_edit_tree_path
(
@project
,
@id
),
method: :put
,
class:
"form-horizontal"
)
do
=
form_tag
(
project_edit_tree_path
(
@project
,
@id
),
method: :put
,
class:
"form-horizontal"
)
do
.file-holder.file
=
render
'projects/blob_editor'
,
ref:
@ref
,
path:
@path
,
blob_data:
@blob
.
data
.file-title
%i
.fa.fa-file
%span
.file_name
%span
.monospace.light
#{
@ref
}
:
=
@path
%span
.options
.btn-group.tree-btn-group
=
link_to
"Cancel"
,
@after_edit_path
,
class:
"btn btn-tiny btn-cancel"
,
data:
{
confirm:
leave_edit_message
}
.file-content.code
%pre
.js-edit-mode-pane
#editor
.js-edit-mode-pane
#preview
.hide
.center
%h2
%i
.fa.fa-spinner.fa-spin
=
render
'shared/commit_message_container'
,
params:
params
,
=
render
'shared/commit_message_container'
,
params:
params
,
placeholder:
"Update
#{
@blob
.
name
}
"
placeholder:
"Update
#{
@blob
.
name
}
"
=
hidden_field_tag
'last_commit'
,
@last_commit
=
hidden_field_tag
'last_commit'
,
@last_commit
...
@@ -34,7 +20,6 @@
...
@@ -34,7 +20,6 @@
ace
.
config
.
loadModule
(
"
ace/ext/searchbox
"
);
ace
.
config
.
loadModule
(
"
ace/ext/searchbox
"
);
var
ace_mode
=
"
#{
@blob
.
language
.
try
(
:ace_mode
)
}
"
;
var
ace_mode
=
"
#{
@blob
.
language
.
try
(
:ace_mode
)
}
"
;
var
editor
=
ace
.
edit
(
"
editor
"
);
var
editor
=
ace
.
edit
(
"
editor
"
);
editor
.
setValue
(
"
#{
escape_javascript
(
@blob
.
data
)
}
"
);
if
(
ace_mode
)
{
if
(
ace_mode
)
{
editor
.
getSession
().
setMode
(
'
ace/mode/
'
+
ace_mode
);
editor
.
getSession
().
setMode
(
'
ace/mode/
'
+
ace_mode
);
}
}
...
...
app/views/projects/new_tree/show.html.haml
View file @
6f78be4d
...
@@ -19,12 +19,7 @@
...
@@ -19,12 +19,7 @@
Encoding
Encoding
.col-sm-10
.col-sm-10
=
select_tag
:encoding
,
options_for_select
([
"base64"
,
"text"
],
"text"
),
class:
'form-control'
=
select_tag
:encoding
,
options_for_select
([
"base64"
,
"text"
],
"text"
),
class:
'form-control'
.file-holder
=
render
'projects/blob_editor'
,
ref:
@ref
.file-title
%i
.fa.fa-file
.file-content.code
%pre
#editor
=
params
[
:content
]
=
render
'shared/commit_message_container'
,
params:
params
,
=
render
'shared/commit_message_container'
,
params:
params
,
placeholder:
'Add new file'
placeholder:
'Add new file'
=
hidden_field_tag
'content'
,
''
,
id:
'file-content'
=
hidden_field_tag
'content'
,
''
,
id:
'file-content'
...
...
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