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
Tatuya Kamada
gitlab-ce
Commits
1a0082b4
Commit
1a0082b4
authored
Apr 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hime last push widget if user already has MR created
parent
65f0ed4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+14
-6
No files found.
app/helpers/application_helper.rb
View file @
1a0082b4
...
...
@@ -137,13 +137,21 @@ module ApplicationHelper
end
end
# Define whenever show last push event
# with suggestion to create MR
def
show_last_push_widget?
(
event
)
event
&&
event
.
last_push_to_non_root?
&&
!
event
.
rm_ref?
&&
event
.
project
&&
event
.
project
.
repository
&&
event
.
project
.
merge_requests_enabled
# Skip if event is not about added or modified non-master branch
return
false
unless
event
&&
event
.
last_push_to_non_root?
&&
!
event
.
rm_ref?
project
=
event
.
project
# Skip if project repo is empty or MR disabled
return
false
unless
project
&&
!
project
.
empty_repo?
&&
project
.
merge_requests_enabled
# Skip if user already created appropriate MR
return
false
if
project
.
merge_requests
.
where
(
source_branch:
event
.
branch_name
).
opened
.
any?
true
end
def
hexdigest
(
string
)
...
...
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