Merge branch 'master' of github.com:gitlabhq/gitlabhq
This commit is contained in:
commit
4df4b38185
|
@ -477,6 +477,17 @@ body.project-page table.no-borders td{
|
|||
|
||||
#tree-content-holder { float:left; width:100%; }
|
||||
|
||||
#tree-readme-holder {
|
||||
float:left;
|
||||
width:100%;
|
||||
|
||||
.readme {
|
||||
@include round-borders-all(4px);
|
||||
padding: 4px 15px;
|
||||
background:#F7F7F7;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Commit Page */
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
require 'digest/md5'
|
||||
module ApplicationHelper
|
||||
include Utils::CharEncode
|
||||
|
||||
def gravatar_icon(user_email)
|
||||
gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com"
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
module CommitsHelper
|
||||
include Utils::CharEncode
|
||||
|
||||
def old_line_number(line, i)
|
||||
|
||||
end
|
||||
|
|
|
@ -35,6 +35,12 @@
|
|||
- contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content|
|
||||
= render :partial => "refs/tree_item", :locals => { :content => content }
|
||||
|
||||
- if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme\.(md|markdown)$/i }.first
|
||||
#tree-readme-holder
|
||||
%h3= content.name
|
||||
.readme
|
||||
= markdown(encode content.data)
|
||||
|
||||
:javascript
|
||||
$(function(){
|
||||
$('select#branch').selectmenu({style:'popup', width:200});
|
||||
|
|
|
@ -18,13 +18,14 @@ module Utils
|
|||
|
||||
module CharEncode
|
||||
def encode(string)
|
||||
return '' unless string
|
||||
cd = CharDet.detect(string)
|
||||
if cd.confidence > 0.6
|
||||
string.force_encoding(cd.encoding)
|
||||
end
|
||||
string.encode("utf-8", :undef => :replace, :replace => "?", :invalid => :replace)
|
||||
rescue
|
||||
"Invalid code encoding"
|
||||
"Invalid Encoding"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue