Merge commit 'master' into discussions
Conflicts: app/assets/stylesheets/sections/notes.scss app/contexts/notes/load_context.rb app/models/project.rb app/observers/note_observer.rb app/roles/votes.rb app/views/commit/show.html.haml app/views/merge_requests/_show.html.haml app/views/merge_requests/diffs.js.haml app/views/merge_requests/show.js.haml app/views/notes/_note.html.haml features/steps/project/project_merge_requests.rb spec/models/note_spec.rb
This commit is contained in:
commit
3022786948
930 changed files with 80374 additions and 103682 deletions
|
@ -53,7 +53,7 @@ module ApplicationHelper
|
|||
|
||||
def last_commit(project)
|
||||
if project.repo_exists?
|
||||
time_ago_in_words(project.commit.committed_date) + " ago"
|
||||
time_ago_in_words(project.repository.commit.committed_date) + " ago"
|
||||
else
|
||||
"Never"
|
||||
end
|
||||
|
@ -62,9 +62,11 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def grouped_options_refs(destination = :tree)
|
||||
repository = @project.repository
|
||||
|
||||
options = [
|
||||
["Branch", @project.branch_names ],
|
||||
[ "Tag", @project.tag_names ]
|
||||
["Branch", repository.branch_names ],
|
||||
[ "Tag", repository.tag_names ]
|
||||
]
|
||||
|
||||
# If reference is commit id -
|
||||
|
@ -78,7 +80,8 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def search_autocomplete_source
|
||||
projects = current_user.projects.map{ |p| { label: p.name_with_namespace, url: project_path(p) } }
|
||||
projects = current_user.authorized_projects.map { |p| { label: p.name_with_namespace, url: project_path(p) } }
|
||||
groups = current_user.authorized_groups.map { |group| { label: "<group> #{group.name}", url: group_path(group) } }
|
||||
|
||||
default_nav = [
|
||||
{ label: "My Profile", url: profile_path },
|
||||
|
@ -99,21 +102,21 @@ module ApplicationHelper
|
|||
]
|
||||
|
||||
project_nav = []
|
||||
if @project && !@project.new_record?
|
||||
if @project && @project.repository && @project.repository.root_ref
|
||||
project_nav = [
|
||||
{ label: "#{@project.name} Issues", url: project_issues_path(@project) },
|
||||
{ label: "#{@project.name} Commits", url: project_commits_path(@project, @ref || @project.root_ref) },
|
||||
{ label: "#{@project.name} Commits", url: project_commits_path(@project, @ref || @project.repository.root_ref) },
|
||||
{ label: "#{@project.name} Merge Requests", url: project_merge_requests_path(@project) },
|
||||
{ label: "#{@project.name} Milestones", url: project_milestones_path(@project) },
|
||||
{ label: "#{@project.name} Snippets", url: project_snippets_path(@project) },
|
||||
{ label: "#{@project.name} Team", url: project_team_index_path(@project) },
|
||||
{ label: "#{@project.name} Tree", url: project_tree_path(@project, @ref || @project.root_ref) },
|
||||
{ label: "#{@project.name} Tree", url: project_tree_path(@project, @ref || @project.repository.root_ref) },
|
||||
{ label: "#{@project.name} Wall", url: wall_project_path(@project) },
|
||||
{ label: "#{@project.name} Wiki", url: project_wikis_path(@project) },
|
||||
]
|
||||
end
|
||||
|
||||
[projects, default_nav, project_nav, help_nav].flatten.to_json
|
||||
[groups, projects, default_nav, project_nav, help_nav].flatten.to_json
|
||||
end
|
||||
|
||||
def emoji_autocomplete_source
|
||||
|
@ -139,6 +142,7 @@ module ApplicationHelper
|
|||
event.last_push_to_non_root? &&
|
||||
!event.rm_ref? &&
|
||||
event.project &&
|
||||
event.project.repository &&
|
||||
event.project.merge_requests_enabled
|
||||
end
|
||||
|
||||
|
|
|
@ -70,4 +70,12 @@ module CommitsHelper
|
|||
escape_javascript(render 'commits/commit', commit: commit)
|
||||
end
|
||||
end
|
||||
|
||||
def diff_line_content(line)
|
||||
if line.blank?
|
||||
" "
|
||||
else
|
||||
line
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,25 +20,8 @@ module EventsHelper
|
|||
[event.action_name, target].join(" ")
|
||||
end
|
||||
|
||||
def event_image event
|
||||
event_image_path = if event.push?
|
||||
"event_push.png"
|
||||
elsif event.merged?
|
||||
"event_mr_merged.png"
|
||||
end
|
||||
|
||||
return nil unless event_image_path
|
||||
|
||||
content_tag :div, class: 'event_icon' do
|
||||
image_tag event_image_path
|
||||
end
|
||||
end
|
||||
|
||||
def event_filter_link key, tooltip
|
||||
key = key.to_s
|
||||
|
||||
filter = @event_filter.options key
|
||||
|
||||
inactive = if @event_filter.active? key
|
||||
nil
|
||||
else
|
||||
|
@ -46,7 +29,7 @@ module EventsHelper
|
|||
end
|
||||
|
||||
content_tag :div, class: "filter_icon #{inactive}" do
|
||||
link_to dashboard_path(event_filter: filter), class: 'has_tooltip', 'data-original-title' => tooltip do
|
||||
link_to dashboard_path, class: 'has_tooltip event_filter_link', id: "#{key}_event_filter", 'data-original-title' => tooltip do
|
||||
image_tag "event_filter_#{key}.png"
|
||||
end
|
||||
end
|
||||
|
|
17
app/helpers/groups_helper.rb
Normal file
17
app/helpers/groups_helper.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
module GroupsHelper
|
||||
def group_filter_path(entity, options={})
|
||||
exist_opts = {
|
||||
status: params[:status],
|
||||
project_id: params[:project_id],
|
||||
}
|
||||
|
||||
options = exist_opts.merge(options)
|
||||
|
||||
case entity
|
||||
when 'issue' then
|
||||
issues_group_path(@group, options)
|
||||
when 'merge_request'
|
||||
merge_requests_group_path(@group, options)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -4,7 +4,7 @@ module MergeRequestsHelper
|
|||
event.project,
|
||||
merge_request: {
|
||||
source_branch: event.branch_name,
|
||||
target_branch: event.project.root_ref,
|
||||
target_branch: event.project.repository.root_ref,
|
||||
title: event.branch_name.titleize
|
||||
}
|
||||
)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module NamespacesHelper
|
||||
def namespaces_options(selected = :current_user, scope = :default)
|
||||
groups = current_user.namespaces.select {|n| n.type == 'Group'}
|
||||
groups = current_user.owned_groups.select {|n| n.type == 'Group'}
|
||||
|
||||
users = if scope == :all
|
||||
Namespace.root
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue