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
Jérome Perrin
gitlab-ce
Commits
006089f9
Commit
006089f9
authored
Feb 02, 2016
by
Rubén Dávila
Committed by
Robert Speicher
Feb 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new endpoint and button to revert any commit.
parent
b6fe51b9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
app/views/projects/commit/_commit_box.html.haml
app/views/projects/commit/_commit_box.html.haml
+2
-0
app/views/projects/commit/_revert.html.haml
app/views/projects/commit/_revert.html.haml
+31
-0
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/views/projects/commit/_commit_box.html.haml
View file @
006089f9
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@commit
),
class:
"btn btn-grouped"
do
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@commit
),
class:
"btn btn-grouped"
do
=
icon
(
'files-o'
)
=
icon
(
'files-o'
)
Browse Files
Browse Files
=
link_to
'#modal-revert-commit'
,
{
'data-target'
=>
'#modal-revert-commit'
,
'data-toggle'
=>
'modal'
,
class:
'btn btn-grouped'
}
do
Revert
%div
%div
%p
%p
...
...
app/views/projects/commit/_revert.html.haml
0 → 100644
View file @
006089f9
#modal-revert-commit
.modal
.modal-dialog
.modal-content
.modal-header
%a
.close
{
href:
"#"
,
"data-dismiss"
=>
"modal"
}
×
%h3
.page-title
Revert commit
.modal-body
=
form_tag
revert_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
),
method: :post
,
remote:
false
,
class:
'form-horizontal js-create-dir-form js-requires-input'
do
.form-group.branch
=
label_tag
'target_branch'
,
'Target branch'
,
class:
'control-label'
.col-sm-10
=
text_field_tag
'target_branch'
,
nil
,
required:
true
,
class:
"form-control js-target-branch"
-
if
can?
(
current_user
,
:push_code
,
@project
)
.js-create-merge-request-container
.checkbox
-
nonce
=
SecureRandom
.
hex
=
label_tag
"create_merge_request-
#{
nonce
}
"
do
=
check_box_tag
'create_merge_request'
,
1
,
true
,
class:
'js-create-merge-request'
,
id:
"create_merge_request-
#{
nonce
}
"
Start a
<strong>
new merge request
</strong>
with these changes
-
else
=
hidden_field_tag
'create_merge_request'
,
1
.form-actions
=
submit_tag
"Revert"
,
class:
'btn btn-create'
=
link_to
"Cancel"
,
'#'
,
class:
"btn btn-cancel"
,
"data-dismiss"
=>
"modal"
-
unless
can?
(
current_user
,
:push_code
,
@project
)
.inline.prepend-left-10
=
commit_in_fork_help
:javascript
new
NewCommitForm
(
$
(
'
.js-create-dir-form
'
))
config/routes.rb
View file @
006089f9
...
@@ -502,6 +502,7 @@ Rails.application.routes.draw do
...
@@ -502,6 +502,7 @@ Rails.application.routes.draw do
get
:builds
get
:builds
post
:cancel_builds
post
:cancel_builds
post
:retry_builds
post
:retry_builds
post
:revert
end
end
end
end
...
...
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