Non-interactive AWS install by running a single script.
Merge branch 'master' into non-interactive-aws-install Conflicts: doc/installation.md Fix merge mess in installation.md
This commit is contained in:
parent
eae41ad1df
commit
b80dd3d242
215 changed files with 3829 additions and 3348 deletions
|
@ -2,10 +2,13 @@ require 'digest/md5'
|
|||
module ApplicationHelper
|
||||
|
||||
def gravatar_icon(user_email = '', size = 40)
|
||||
return unless user_email
|
||||
gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com"
|
||||
user_email.strip!
|
||||
"#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon"
|
||||
if Gitlab.config.disable_gravatar? || user_email.blank?
|
||||
'no_avatar.png'
|
||||
else
|
||||
gravatar_prefix = request.ssl? ? "https://secure" : "http://www"
|
||||
user_email.strip!
|
||||
"#{gravatar_prefix}.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon"
|
||||
end
|
||||
end
|
||||
|
||||
def request_protocol
|
||||
|
@ -75,16 +78,16 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def show_last_push_widget?(event)
|
||||
event &&
|
||||
event &&
|
||||
event.last_push_to_non_root? &&
|
||||
!event.rm_ref? &&
|
||||
event.project &&
|
||||
event.project &&
|
||||
event.project.merge_requests_enabled
|
||||
end
|
||||
|
||||
def tab_class(tab_key)
|
||||
active = case tab_key
|
||||
|
||||
|
||||
# Project Area
|
||||
when :wall; wall_tab?
|
||||
when :wiki; controller.controller_name == "wikis"
|
||||
|
@ -123,4 +126,13 @@ module ApplicationHelper
|
|||
def hexdigest(string)
|
||||
Digest::SHA1.hexdigest string
|
||||
end
|
||||
|
||||
def project_last_activity project
|
||||
activity = project.last_activity
|
||||
if activity && activity.created_at
|
||||
time_ago_in_words(activity.created_at) + " ago"
|
||||
else
|
||||
"Never"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
module GitlabMarkdownHelper
|
||||
# Replaces references (i.e. @abc, #123, !456, ...) in the text with links to
|
||||
# the appropriate items in Gitlab.
|
||||
#
|
||||
# text - the source text
|
||||
# html_options - extra options for the reference links as given to link_to
|
||||
#
|
||||
# note: reference links will only be generated if @project is set
|
||||
#
|
||||
# see Gitlab::Markdown for details on the supported syntax
|
||||
def gfm(text, html_options = {})
|
||||
return text if text.nil?
|
||||
return text if @project.nil?
|
||||
|
||||
# Extract pre blocks
|
||||
# Extract pre blocks so they are not altered
|
||||
# from http://github.github.com/github-flavored-markdown/
|
||||
extractions = {}
|
||||
text.gsub!(%r{<pre>.*?</pre>|<code>.*?</code>}m) do |match|
|
||||
|
@ -22,10 +31,18 @@ module GitlabMarkdownHelper
|
|||
extractions[$1]
|
||||
end
|
||||
|
||||
text.html_safe
|
||||
sanitize text.html_safe, attributes: ActionView::Base.sanitized_allowed_attributes + %w(id class )
|
||||
end
|
||||
|
||||
# circumvents nesting links, which will behave bad in browsers
|
||||
# Use this in places where you would normally use link_to(gfm(...), ...).
|
||||
#
|
||||
# It solves a problem occurring with nested links (i.e.
|
||||
# "<a>outer text <a>gfm ref</a> more outer text</a>"). This will not be
|
||||
# interpreted as intended. Browsers will parse something like
|
||||
# "<a>outer text </a><a>gfm ref</a> more outer text" (notice the last part is
|
||||
# not linked any more). link_to_gfm corrects that. It wraps all parts to
|
||||
# explicitly produce the correct linking behavior (i.e.
|
||||
# "<a>outer text </a><a>gfm ref</a><a> more outer text</a>").
|
||||
def link_to_gfm(body, url, html_options = {})
|
||||
gfm_body = gfm(body, html_options)
|
||||
|
||||
|
@ -37,17 +54,24 @@ module GitlabMarkdownHelper
|
|||
end
|
||||
|
||||
def markdown(text)
|
||||
@__renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::GitlabHTML.new(self, filter_html: true, with_toc_data: true), {
|
||||
no_intra_emphasis: true,
|
||||
tables: true,
|
||||
fenced_code_blocks: true,
|
||||
autolink: true,
|
||||
strikethrough: true,
|
||||
lax_html_blocks: true,
|
||||
space_after_headers: true,
|
||||
superscript: true
|
||||
})
|
||||
unless @markdown
|
||||
gitlab_renderer = Redcarpet::Render::GitlabHTML.new(self,
|
||||
# see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch-
|
||||
filter_html: true,
|
||||
with_toc_data: true,
|
||||
hard_wrap: true)
|
||||
@markdown ||= Redcarpet::Markdown.new(gitlab_renderer,
|
||||
# see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
|
||||
no_intra_emphasis: true,
|
||||
tables: true,
|
||||
fenced_code_blocks: true,
|
||||
autolink: true,
|
||||
strikethrough: true,
|
||||
lax_html_blocks: true,
|
||||
space_after_headers: true,
|
||||
superscript: true)
|
||||
end
|
||||
|
||||
@__renderer.render(text).html_safe
|
||||
@markdown.render(text).html_safe
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue