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
2df57e02
Commit
2df57e02
authored
Oct 31, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build messages used on the project settings page
parent
e009e9c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
app/helpers/push_rules_helper.rb
app/helpers/push_rules_helper.rb
+11
-10
No files found.
app/helpers/push_rules_helper.rb
View file @
2df57e02
module
PushRulesHelper
def
reject_unsigned_commits_description
(
push_rule
)
message
=
[
s_
(
"ProjectSettings|Only signed commits can be pushed to this repository."
)]
message
=
s_
(
"ProjectSettings|Only signed commits can be pushed to this repository."
)
push_rule_update_description
(
message
,
push_rule
,
:reject_unsigned_commits
)
end
def
commit_committer_check_description
(
push_rule
)
message
=
[
s_
(
"ProjectSettings|Only the committer of a commit can push changes to this repository."
)]
message
=
s_
(
"ProjectSettings|Only the committer of a commit can push changes to this repository."
)
push_rule_update_description
(
message
,
push_rule
,
:commit_committer_check
)
end
...
...
@@ -14,23 +14,24 @@ module PushRulesHelper
private
def
push_rule_update_description
(
message
,
push_rule
,
rule
)
messages
=
[
message
]
if
push_rule
.
global?
message
<<
s_
(
"ProjectSettings|This setting will be applied to all projects unless overridden by an admin."
)
message
s
<<
s_
(
"ProjectSettings|This setting will be applied to all projects unless overridden by an admin."
)
else
enabled_globally
=
PushRule
.
global
&
.
public_send
(
rule
)
# rubocop:disable GitlabSecurity/PublicSend
enabled_in_project
=
push_rule
.
public_send
(
rule
)
# rubocop:disable GitlabSecurity/PublicSend
if
enabled_globally
message
<<
if
enabled_in_project
s_
(
"ProjectSettings|This setting is applied on the server level and can be overridden by an admin."
)
else
s_
(
"ProjectSettings|This setting is applied on the server level but has been overridden for this project."
)
end
message
s
<<
if
enabled_in_project
s_
(
"ProjectSettings|This setting is applied on the server level and can be overridden by an admin."
)
else
s_
(
"ProjectSettings|This setting is applied on the server level but has been overridden for this project."
)
end
message
<<
s_
(
"ProjectSettings|Contact an admin to change this setting."
)
unless
current_user
.
admin?
message
s
<<
s_
(
"ProjectSettings|Contact an admin to change this setting."
)
unless
current_user
.
admin?
end
end
message
.
join
(
' '
)
message
s
.
join
(
' '
)
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