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
74217f75
Unverified
Commit
74217f75
authored
Oct 08, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply ConfirmDangerModal for project transfer/remove actions
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
9021debf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
application.js.coffee
app/assets/javascripts/application.js.coffee
+7
-0
projects_helper.rb
app/helpers/projects_helper.rb
+4
-0
edit.html.haml
app/views/projects/edit.html.haml
+11
-7
No files found.
app/assets/javascripts/application.js.coffee
View file @
74217f75
...
...
@@ -177,6 +177,13 @@ $ ->
$
(
@
).
closest
(
".diff-file"
).
find
(
".notes_holder"
).
toggle
()
e
.
preventDefault
()
$
(
document
).
on
"click"
,
'.js-confirm-danger'
,
(
e
)
->
e
.
preventDefault
()
btn
=
$
(
e
.
target
)
text
=
btn
.
data
(
"confirm-danger-message"
)
form
=
btn
.
closest
(
"form"
)
new
ConfirmDangerModal
(
form
,
text
)
((
$
)
->
# Disable an element and add the 'disabled' Bootstrap class
$
.
fn
.
extend
disable
:
->
...
...
app/helpers/projects_helper.rb
View file @
74217f75
...
...
@@ -56,6 +56,10 @@ module ProjectsHelper
"You are going to remove
#{
project
.
name_with_namespace
}
.
\n
Removed project CANNOT be restored!
\n
Are you ABSOLUTELY sure?"
end
def
transfer_project_message
(
project
)
"You are going to transfer
#{
project
.
name_with_namespace
}
to another owner. Are you ABSOLUTELY sure?"
end
def
project_nav_tabs
@nav_tabs
||=
get_project_nav_tabs
(
@project
,
current_user
)
end
...
...
app/views/projects/edit.html.haml
View file @
74217f75
...
...
@@ -104,7 +104,7 @@
%strong
Once active this project shows up in the search and on the dashboard.
=
link_to
'Unarchive'
,
unarchive_project_path
(
@project
),
data:
{
confirm:
"Are you sure that you want to unarchive this project?
\n
When this project is unarchived it is active and can be committed to again."
},
method: :post
,
class:
"btn btn-
remove
"
method: :post
,
class:
"btn btn-
success
"
-
else
%p
Archiving the project will mark its repository as read-only.
...
...
@@ -154,7 +154,7 @@
%li
You can only transfer the project to namespaces you manage.
%li
You will need to update your local repositories to point to the new location.
.form-actions
=
f
.
submit
'Transfer'
,
class:
"btn btn-remove
"
=
f
.
submit
'Transfer'
,
class:
"btn btn-remove
js-confirm-danger"
,
data:
{
"confirm-danger-message"
=>
transfer_project_message
(
@project
)
}
-
else
.nothing-here-block
Only the project owner can transfer a project
...
...
@@ -162,12 +162,13 @@
.panel.panel-default.panel.panel-danger
.panel-heading
Remove project
.panel-body
%p
Removing the project will delete its repository and all related resources including issues, merge requests etc.
%br
%strong
Removed projects cannot be restored!
=
form_tag
(
project_path
(
@project
),
method: :delete
,
html:
{
class:
'form-horizontal'
})
do
%p
Removing the project will delete its repository and all related resources including issues, merge requests etc.
%br
%strong
Removed projects cannot be restored!
=
link_to
'Remove project'
,
@project
,
data:
{
confirm:
remove_project_message
(
@project
)
},
method: :delete
,
class:
"btn btn-remove"
=
link_to
'Remove project'
,
'#'
,
class:
"btn btn-remove js-confirm-danger"
,
data:
{
"confirm-danger-message"
=>
remove_project_message
(
@project
)
}
-
else
.nothing-here-block
Only project owner can remove a project
...
...
@@ -177,3 +178,6 @@
%i
.fa.fa-spinner.fa-spin
Saving project.
%p
Please wait a moment, this page will automatically refresh when ready.
=
render
'shared/confirm_modal'
,
phrase:
@project
.
path
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