Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-04-07 22:13:37 +0400
committerMarin Jankovski <marin@gitlab.com>2014-04-07 22:13:37 +0400
commitaf5ea92cc4c0eb9577bb4de2ffc5a873a37fec49 (patch)
tree07d9e5c635fc16a1c449c94876910ca8005b3b64 /app
parentaea3712e8dd71092847eeaec6f934a426d1becc0 (diff)
parent38ae34a30131aef38623ac5cf8c510ad04fc26a6 (diff)
Merge branch 'master' into login_page
Conflicts: CHANGELOG
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/merge_requests_controller.rb10
-rw-r--r--app/models/merge_request.rb2
-rw-r--r--app/views/devise/sessions/_oauth_providers.html.haml2
-rw-r--r--app/views/projects/notes/_discussion.html.haml21
4 files changed, 12 insertions, 23 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index d6402dd217d..872b9500130 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -216,7 +216,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def allowed_to_merge?
- allowed_to_push_code?(project)
+ allowed_to_push_code?(project, @merge_request.target_branch)
end
def invalid_mr
@@ -225,17 +225,17 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def allowed_to_remove_source_branch?
- allowed_to_push_code?(@merge_request.source_project) &&
+ allowed_to_push_code?(@merge_request.source_project, @merge_request.source_branch) &&
!@merge_request.disallow_source_branch_removal?
end
- def allowed_to_push_code?(project)
- action = if project.protected_branch?(@merge_request.target_branch)
+ def allowed_to_push_code?(project, branch)
+ action = if project.protected_branch?(branch)
:push_code_to_protected_branches
else
:push_code
end
- can?(current_user, action, @project)
+ can?(current_user, action, project)
end
end
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 0decc7782ee..1ec76dbd39a 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -210,7 +210,7 @@ class MergeRequest < ActiveRecord::Base
end
def disallow_source_branch_removal?
- (source_project.root_ref? source_branch) || for_fork?
+ source_project.root_ref?(source_branch) || source_project.protected_branches.include?(source_branch)
end
def project
diff --git a/app/views/devise/sessions/_oauth_providers.html.haml b/app/views/devise/sessions/_oauth_providers.html.haml
index f4556eea4a2..935bc6af505 100644
--- a/app/views/devise/sessions/_oauth_providers.html.haml
+++ b/app/views/devise/sessions/_oauth_providers.html.haml
@@ -2,7 +2,7 @@
- if providers.present?
%hr
%div{:'data-no-turbolink' => 'data-no-turbolink'}
- %span Sign in with*: &nbsp;
+ %span Sign in with: &nbsp;
- providers.each do |provider|
%span
- if default_providers.include?(provider)
diff --git a/app/views/projects/notes/_discussion.html.haml b/app/views/projects/notes/_discussion.html.haml
index 9b1f4d77587..78793eb860f 100644
--- a/app/views/projects/notes/_discussion.html.haml
+++ b/app/views/projects/notes/_discussion.html.haml
@@ -1,13 +1,10 @@
- note = discussion_notes.first
-.discussion.js-details-container.js-toggler-container.open{ class: note.discussion_id }
+.discussion.js-toggle-container{ class: note.discussion_id }
.discussion-header
.discussion-actions
- = link_to "javascript:;", class: "js-details-target turn-on js-toggler-target" do
- %i.icon-eye-close
- Hide discussion
- = link_to "javascript:;", class: "js-details-target turn-off js-toggler-target" do
- %i.icon-eye-open
- Show discussion
+ = link_to "#", class: "js-toggle-button" do
+ %i.icon-chevron-up
+ Show/hide discussion
= image_tag avatar_icon(note.author_email), class: "avatar s32"
%div
= link_to_member(@project, note.author, avatar: false)
@@ -33,7 +30,7 @@
= link_to_member(@project, last_note.author, avatar: false)
%span.discussion-last-update
#{time_ago_with_tooltip(last_note.updated_at, 'bottom', 'discussion_updated_ago')}
- .discussion-body
+ .discussion-body.js-toggle-content
- if note.for_diff_line?
- if note.active?
= render "projects/notes/discussion_diff", discussion_notes: discussion_notes, note: note
@@ -47,11 +44,3 @@
.notes{ rel: discussion_notes.first.discussion_id }
= render discussion_notes
= render "projects/notes/discussion_reply_button", note: discussion_notes.first
-
- -# will be shown when the other one is hidden
- .discussion-hidden.content.hide
- .note
- %em Hidden discussion.
- = link_to "javascript:;", class: "js-details-target js-toggler-target" do
- %i.icon-eye-open
- Show