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
98e938bd
Commit
98e938bd
authored
Nov 17, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix editor form, styles and JS
parent
7caf4de2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
14 deletions
+58
-14
app/assets/stylesheets/sections/editor.scss
app/assets/stylesheets/sections/editor.scss
+35
-4
app/views/tree/edit.html.haml
app/views/tree/edit.html.haml
+23
-10
No files found.
app/assets/stylesheets/sections/editor.scss
View file @
98e938bd
.file-editor
{
.file-editor
{
#editor
{
#editor
{
border
:
none
;
border
:
none
;
border-radius
:
0
;
height
:
500px
;
height
:
500px
;
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
position
:
relative
;
position
:
relative
;
width
:
100%
;
width
:
100%
;
}
}
.editor-commit-comment
{
padding-top
:
20px
;
.cancel-btn
{
color
:
#B94A48
;
&
:hover
{
color
:
#B94A48
;
}
}
.commit-button-annotation
{
@extend
.alert
;
@extend
.alert-info
;
display
:
inline-block
;
margin
:
0
;
padding
:
2px
;
>
*
{
float
:
left
;
}
.commit-btn
{
@extend
.save-btn
;
}
.message
{
display
:
inline-block
;
margin
:
5px
8px
0
8px
;
}
}
.commit_message-group
{
margin-top
:
20px
;
label
{
font-size
:
16px
;
line-height
:
20px
;
}
textarea
{
textarea
{
width
:
50%
;
@extend
.span8
;
margin-left
:
20px
;
}
}
}
}
}
}
app/views/tree/edit.html.haml
View file @
98e938bd
.file-editor
.file-editor
=
form_tag
(
project_tree_path
(
@project
,
@id
),
:method
=>
:put
)
do
=
form_tag
(
project_tree_path
(
@project
,
@id
),
method: :put
,
class:
"form-horizontal"
)
do
.file_holder
.file_holder
.file_title
.file_title
%i
.icon-file
%i
.icon-file
%span
.file_name
%span
.file_name
=
"
#{
@tree
.
path
}
(
#{
@ref
}
)"
=
@tree
.
path
%small
on
%strong
=
@ref
%span
.options
.btn-group.tree-btn-group
=
link_to
"Cancel"
,
project_tree_path
(
@project
,
@id
),
class:
"btn very_small cancel-btn"
,
confirm:
"Are you sure?"
.file_content.code
.file_content.code
%pre
#editor
=
@tree
.
data
%pre
#editor
=
@tree
.
data
.editor-commit-comment
.control-group.commit_message-group
=
label_tag
'commit_message'
do
=
label_tag
'commit_message'
,
class:
"control-label"
do
%p
.slead
Commit message
Commit message
=
text_area_tag
'commit_message'
,
''
,
:required
=>
true
.controls
=
text_area_tag
'commit_message'
,
''
,
placeholder:
"Update
#{
@tree
.
name
}
"
,
required:
true
,
rows:
3
.form-actions
.form-actions
=
hidden_field_tag
'last_commit'
,
@last_commit
=
hidden_field_tag
'last_commit'
,
@last_commit
=
hidden_field_tag
'content'
,
''
,
:id
=>
:file_content
=
hidden_field_tag
'content'
,
''
,
id: :file_content
=
button_tag
"Commit"
,
class:
'btn save-btn'
.commit-button-annotation
=
button_tag
"Commit"
,
class:
'btn commit-btn js-commit-button'
.message
to branch
%strong
=
@ref
=
link_to
"Cancel"
,
project_tree_path
(
@project
,
@id
),
class:
"btn cancel-btn"
,
confirm:
"Are you sure?"
=
link_to
"Cancel"
,
project_tree_path
(
@project
,
@id
),
class:
"btn cancel-btn"
,
confirm:
"Are you sure?"
:javascript
:javascript
...
@@ -25,7 +36,9 @@
...
@@ -25,7 +36,9 @@
editor
.
getSession
().
setMode
(
'
ace/mode/
'
+
ace_mode
);
editor
.
getSession
().
setMode
(
'
ace/mode/
'
+
ace_mode
);
}
}
$
(
"
.save-btn
"
).
click
(
function
(){
disableButtonIfEmptyField
(
"
#commit_message
"
,
"
.js-commit-button
"
);
$
(
"
.js-commit-button
"
).
click
(
function
(){
$
(
"
#file_content
"
).
val
(
editor
.
getValue
());
$
(
"
#file_content
"
).
val
(
editor
.
getValue
());
$
(
"
.f
orm_
editor form
"
).
submit
();
$
(
"
.f
ile-
editor form
"
).
submit
();
});
});
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