Merge branch 'master' into discussions
Conflicts: app/assets/stylesheets/main.scss app/models/project.rb app/views/notes/_common_form.html.haml app/views/notes/_per_line_form.html.haml lib/gitlab/markdown.rb spec/models/note_spec.rb
This commit is contained in:
commit
db2c15369c
276 changed files with 4466 additions and 2603 deletions
|
@ -1,4 +1,5 @@
|
|||
require 'digest/md5'
|
||||
require 'uri'
|
||||
|
||||
module ApplicationHelper
|
||||
|
||||
|
@ -30,13 +31,15 @@ module ApplicationHelper
|
|||
args.any? { |v| v.to_s.downcase == action_name }
|
||||
end
|
||||
|
||||
def gravatar_icon(user_email = '', size = 40)
|
||||
if Gitlab.config.disable_gravatar? || user_email.blank?
|
||||
def gravatar_icon(user_email = '', size = nil)
|
||||
size = 40 if size.nil? || size <= 0
|
||||
|
||||
if !Gitlab.config.gravatar.enabled || user_email.blank?
|
||||
'no_avatar.png'
|
||||
else
|
||||
gravatar_prefix = request.ssl? ? "https://secure" : "http://www"
|
||||
gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
|
||||
user_email.strip!
|
||||
"#{gravatar_prefix}.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=mm"
|
||||
sprintf(gravatar_url, {:hash => Digest::MD5.hexdigest(user_email.downcase), :email => URI.escape(user_email), :size => size})
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -45,7 +48,7 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def web_app_url
|
||||
"#{request_protocol}://#{Gitlab.config.web_host}/"
|
||||
"#{request_protocol}://#{Gitlab.config.gitlab.host}/"
|
||||
end
|
||||
|
||||
def last_commit(project)
|
||||
|
@ -92,6 +95,7 @@ module ApplicationHelper
|
|||
{ label: "API Help", url: help_api_path },
|
||||
{ label: "Markdown Help", url: help_markdown_path },
|
||||
{ label: "SSH Keys Help", url: help_ssh_path },
|
||||
{ label: "Gitlab Rake Tasks Help", url: help_raketasks_path },
|
||||
]
|
||||
|
||||
project_nav = []
|
||||
|
|
|
@ -4,28 +4,6 @@ module IssuesHelper
|
|||
project_issues_path project, params
|
||||
end
|
||||
|
||||
def link_to_issue_assignee(issue)
|
||||
project = issue.project
|
||||
|
||||
tm = project.team_member_by_id(issue.assignee_id)
|
||||
if tm
|
||||
link_to issue.assignee_name, project_team_member_path(project, tm), class: "author_link"
|
||||
else
|
||||
issue.assignee_name
|
||||
end
|
||||
end
|
||||
|
||||
def link_to_issue_author(issue)
|
||||
project = issue.project
|
||||
|
||||
tm = project.team_member_by_id(issue.author_id)
|
||||
if tm
|
||||
link_to issue.author_name, project_team_member_path(project, tm), class: "author_link"
|
||||
else
|
||||
issue.author_name
|
||||
end
|
||||
end
|
||||
|
||||
def issue_css_classes issue
|
||||
classes = "issue"
|
||||
classes << " closed" if issue.closed
|
||||
|
@ -52,4 +30,14 @@ module IssuesHelper
|
|||
open: "open"
|
||||
}
|
||||
end
|
||||
|
||||
def labels_autocomplete_source
|
||||
labels = @project.issues_labels.order('count DESC')
|
||||
labels = labels.map{ |l| { label: l.name, value: l.name } }
|
||||
labels.to_json
|
||||
end
|
||||
|
||||
def issues_active_milestones
|
||||
@project.milestones.active.order("id desc").all
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,26 +1,4 @@
|
|||
module MergeRequestsHelper
|
||||
def link_to_merge_request_assignee(merge_request)
|
||||
project = merge_request.project
|
||||
|
||||
tm = project.team_member_by_id(merge_request.assignee_id)
|
||||
if tm
|
||||
link_to merge_request.assignee_name, project_team_member_path(project, tm), class: "author_link"
|
||||
else
|
||||
merge_request.assignee_name
|
||||
end
|
||||
end
|
||||
|
||||
def link_to_merge_request_author(merge_request)
|
||||
project = merge_request.project
|
||||
|
||||
tm = project.team_member_by_id(merge_request.author_id)
|
||||
if tm
|
||||
link_to merge_request.author_name, project_team_member_path(project, tm), class: "author_link"
|
||||
else
|
||||
merge_request.author_name
|
||||
end
|
||||
end
|
||||
|
||||
def new_mr_path_from_push_event(event)
|
||||
new_project_merge_request_path(
|
||||
event.project,
|
||||
|
@ -39,7 +17,7 @@ module MergeRequestsHelper
|
|||
classes
|
||||
end
|
||||
|
||||
def ci_status_path
|
||||
@project.gitlab_ci_service.commit_badge_path(@merge_request.last_commit.sha)
|
||||
def ci_build_details_path merge_request
|
||||
merge_request.project.gitlab_ci_service.build_page(merge_request.last_commit.sha)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,11 +8,49 @@ module ProjectsHelper
|
|||
end
|
||||
|
||||
def link_to_project project
|
||||
link_to project.name, project
|
||||
link_to project do
|
||||
title = content_tag(:strong, project.name)
|
||||
|
||||
if project.namespace
|
||||
namespace = content_tag(:span, "#{project.namespace.human_name} / ", class: 'tiny')
|
||||
title = namespace + title
|
||||
end
|
||||
|
||||
title
|
||||
end
|
||||
end
|
||||
|
||||
def link_to_member(project, author)
|
||||
return "(deleted)" unless author
|
||||
|
||||
# Build avatar image tag
|
||||
avatar = image_tag(gravatar_icon(author.try(:email)), width: 16, class: "lil_av")
|
||||
|
||||
# Build name strong tag
|
||||
name = content_tag :strong, author.name, class: 'author'
|
||||
|
||||
author_html = avatar + name
|
||||
|
||||
tm = project.team_member_by_id(author)
|
||||
|
||||
content_tag :span, class: 'member-link' do
|
||||
if tm
|
||||
link_to author_html, project_team_member_path(project, tm), class: "author_link"
|
||||
else
|
||||
author_html
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def tm_path team_member
|
||||
project_team_member_path(@project, team_member)
|
||||
end
|
||||
end
|
||||
|
||||
def project_title project
|
||||
if project.group
|
||||
project.name_with_namespace
|
||||
else
|
||||
project.name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -72,7 +72,7 @@ module TabHelper
|
|||
return "active" if current_page?(controller: "projects", action: action, id: @project)
|
||||
end
|
||||
|
||||
if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
|
||||
if ['snippets', 'services', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
|
||||
"active"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue