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
f366c5f9
Commit
f366c5f9
authored
Feb 20, 2018
by
André Luís
Committed by
Clement Ho
Feb 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Internationalize Locked files page
parent
b084f3a3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
13 deletions
+18
-13
app/services/lfs/unlock_file_service.rb
app/services/lfs/unlock_file_service.rb
+4
-4
changelogs/unreleased-ee/4929-internationalize-lock-files.yml
...gelogs/unreleased-ee/4929-internationalize-lock-files.yml
+5
-0
ee/app/controllers/projects/path_locks_controller.rb
ee/app/controllers/projects/path_locks_controller.rb
+1
-1
ee/app/models/path_lock.rb
ee/app/models/path_lock.rb
+2
-2
ee/app/services/path_locks/unlock_service.rb
ee/app/services/path_locks/unlock_service.rb
+1
-1
ee/app/views/projects/path_locks/_path_lock.html.haml
ee/app/views/projects/path_locks/_path_lock.html.haml
+2
-2
ee/app/views/projects/path_locks/index.html.haml
ee/app/views/projects/path_locks/index.html.haml
+3
-3
No files found.
app/services/lfs/unlock_file_service.rb
View file @
f366c5f9
...
...
@@ -4,14 +4,14 @@ module Lfs
def
execute
unless
can?
(
current_user
,
:push_code
,
project
)
raise
Gitlab
::
GitAccess
::
UnauthorizedError
,
'You have no permissions'
raise
Gitlab
::
GitAccess
::
UnauthorizedError
,
_
(
'You have no permissions'
)
end
unlock_file
rescue
Gitlab
::
GitAccess
::
UnauthorizedError
=>
ex
error
(
ex
.
message
,
403
)
rescue
ActiveRecord
::
RecordNotFound
error
(
'Lock not found'
,
404
)
error
(
_
(
'Lock not found'
)
,
404
)
rescue
=>
ex
error
(
ex
.
message
,
500
)
end
...
...
@@ -26,9 +26,9 @@ module Lfs
success
(
lock:
lock
,
http_status: :ok
)
elsif
forced
error
(
'You must have master access to force delete a lock'
,
403
)
error
(
_
(
'You must have master access to force delete a lock'
)
,
403
)
else
error
(
"
#{
lock
.
path
}
is locked by GitLab User
#{
lock
.
user_id
}
"
,
403
)
error
(
_
(
"%{lock_path} is locked by GitLab User %{lock_user_id}"
)
%
{
lock_path:
lock
.
path
,
lock_user_id:
lock
.
user_id
}
,
403
)
end
end
...
...
changelogs/unreleased-ee/4929-internationalize-lock-files.yml
0 → 100644
View file @
f366c5f9
---
title
:
Translate Locked files page
merge_request
:
author
:
type
:
other
ee/app/controllers/projects/path_locks_controller.rb
View file @
f366c5f9
...
...
@@ -49,7 +49,7 @@ class Projects::PathLocksController < Projects::ApplicationController
def
check_license
unless
@project
.
feature_available?
(
:file_locks
)
flash
[
:alert
]
=
'You need a different license to enable FileLocks feature'
flash
[
:alert
]
=
_
(
'You need a different license to enable FileLocks feature'
)
redirect_to
admin_license_path
end
end
...
...
ee/app/models/path_lock.rb
View file @
f366c5f9
...
...
@@ -33,9 +33,9 @@ class PathLock < ActiveRecord::Base
return
unless
existed_lock
if
existed_lock
.
downstream?
(
path
)
errors
.
add
(
:path
,
'is invalid because there is downstream lock'
)
errors
.
add
(
:path
,
_
(
'is invalid because there is downstream lock'
)
)
elsif
existed_lock
.
upstream?
(
path
)
errors
.
add
(
:path
,
'is invalid because there is upstream lock'
)
errors
.
add
(
:path
,
_
(
'is invalid because there is upstream lock'
)
)
end
end
end
ee/app/services/path_locks/unlock_service.rb
View file @
f366c5f9
...
...
@@ -5,7 +5,7 @@ module PathLocks
include
PathLocksHelper
def
execute
(
path_lock
)
raise
AccessDenied
,
'You have no permissions'
unless
can_unlock?
(
path_lock
)
raise
AccessDenied
,
_
(
'You have no permissions'
)
unless
can_unlock?
(
path_lock
)
path_lock
.
destroy
end
...
...
ee/app/views/projects/path_locks/_path_lock.html.haml
View file @
f366c5f9
...
...
@@ -6,7 +6,7 @@
.controls
-
if
can_unlock?
(
path_lock
)
=
link_to
project_path_lock_path
(
@project
,
path_lock
),
class:
'btn btn-grouped btn-xs btn-remove remove-row has-tooltip'
,
title:
"Unlock"
,
method: :delete
,
data:
{
confirm:
"Are you sure you want to unlock
#{
path_lock
.
path
}
?"
,
container:
'body'
},
remote:
true
do
=
link_to
project_path_lock_path
(
@project
,
path_lock
),
class:
'btn btn-grouped btn-xs btn-remove remove-row has-tooltip'
,
title:
_
(
"Unlock"
),
method: :delete
,
data:
{
confirm:
_
(
"Are you sure you want to unlock %{path_lock_path}?"
)
%
{
path_lock_path:
path_lock
.
path
}
,
container:
'body'
},
remote:
true
do
=
icon
(
"trash-o"
)
locked by
#{
path_lock
.
user
.
name
}
#{
time_ago_with_tooltip
(
path_lock
.
created_at
)
}
=
_
(
"locked by %{path_lock_user_name} %{created_at}"
)
%
{
path_lock_user_name:
path_lock
.
user
.
name
,
created_at:
time_ago_with_tooltip
(
path_lock
.
created_at
)
}
ee/app/views/projects/path_locks/index.html.haml
View file @
f366c5f9
-
@no_container
=
true
-
page_title
"File Locks"
-
page_title
_
(
"Locked Files"
)
%div
{
class:
(
container_class
)
}
.top-area
.nav-text
Locks give the ability to lock specific file or folder.
=
_
(
"Locks give the ability to lock specific file or folder."
)
.locks
-
if
@path_locks
.
any?
...
...
@@ -14,4 +14,4 @@
=
paginate
@path_locks
,
theme:
'gitlab'
-
else
.nothing-here-block
Repository has no locks.
=
_
(
"Repository has no locks."
)
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