Commit 4df4b381852ea432659f488aa713aa336e27b89b
Exists in
master
and in
4 other branches
Merge branch 'master' of github.com:gitlabhq/gitlabhq
Showing
5 changed files
with
33 additions
and
16 deletions
Show diff stats
app/assets/stylesheets/projects.css.scss
| ... | ... | @@ -67,8 +67,8 @@ a { |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | -.view_file .view_file_header, | |
| 71 | -.diff_file .diff_file_header { | |
| 70 | +.view_file .view_file_header, | |
| 71 | +.diff_file .diff_file_header { | |
| 72 | 72 | background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); |
| 73 | 73 | background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); |
| 74 | 74 | background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); |
| ... | ... | @@ -116,7 +116,7 @@ td.code { |
| 116 | 116 | word-wrap:normal; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | -table.highlighttable { | |
| 119 | +table.highlighttable { | |
| 120 | 120 | border: none; |
| 121 | 121 | background: #F7F7F7; |
| 122 | 122 | } |
| ... | ... | @@ -331,7 +331,7 @@ body.project-page table .commit { |
| 331 | 331 | border:none; |
| 332 | 332 | text-shadow:none; |
| 333 | 333 | |
| 334 | - &.inline { | |
| 334 | + &.inline { | |
| 335 | 335 | display:inline; |
| 336 | 336 | } |
| 337 | 337 | |
| ... | ... | @@ -430,28 +430,28 @@ body.projects-page input.text.git-url.project_list_url { width:165px; } |
| 430 | 430 | |
| 431 | 431 | |
| 432 | 432 | body.project-page table.no-borders tr, |
| 433 | -body.project-page table.no-borders td{ | |
| 433 | +body.project-page table.no-borders td{ | |
| 434 | 434 | border:none; |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | -#gitlab-tabs { | |
| 437 | +#gitlab-tabs { | |
| 438 | 438 | .ui-tabs-nav { |
| 439 | 439 | border-bottom: 1px solid #DEDFE1; |
| 440 | 440 | |
| 441 | - li { | |
| 441 | + li { | |
| 442 | 442 | background: none; |
| 443 | 443 | border:none; |
| 444 | 444 | font-size: 16px; |
| 445 | 445 | margin: 0; |
| 446 | 446 | padding: 0; |
| 447 | 447 | |
| 448 | - a { | |
| 448 | + a { | |
| 449 | 449 | margin: 0; |
| 450 | 450 | padding: 10px 16px; |
| 451 | 451 | width:150px; |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - &.ui-tabs-selected { | |
| 454 | + &.ui-tabs-selected { | |
| 455 | 455 | background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); |
| 456 | 456 | background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); |
| 457 | 457 | background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); |
| ... | ... | @@ -466,17 +466,28 @@ body.project-page table.no-borders td{ |
| 466 | 466 | border-top-left-radius: 5px; |
| 467 | 467 | border-top-right-radius: 5px; |
| 468 | 468 | } |
| 469 | - } | |
| 470 | - } | |
| 469 | + } | |
| 470 | + } | |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | -.ajax-tab-loading { | |
| 473 | +.ajax-tab-loading { | |
| 474 | 474 | padding:40px; |
| 475 | 475 | display:none; |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | #tree-content-holder { float:left; width:100%; } |
| 479 | 479 | |
| 480 | +#tree-readme-holder { | |
| 481 | + float:left; | |
| 482 | + width:100%; | |
| 483 | + | |
| 484 | + .readme { | |
| 485 | + @include round-borders-all(4px); | |
| 486 | + padding: 4px 15px; | |
| 487 | + background:#F7F7F7; | |
| 488 | + } | |
| 489 | +} | |
| 490 | + | |
| 480 | 491 | |
| 481 | 492 | |
| 482 | 493 | /* Commit Page */ | ... | ... |
app/helpers/application_helper.rb
app/helpers/commits_helper.rb
app/views/refs/_tree.html.haml
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | %th |
| 22 | 22 | Last commit |
| 23 | 23 | = link_to "history", tree.history_path, :class => "right" |
| 24 | - | |
| 24 | + | |
| 25 | 25 | - if tree.up_dir? |
| 26 | 26 | %tr{ :class => "tree-item", :url => tree.up_dir_path } |
| 27 | 27 | %td.tree-item-file-name |
| ... | ... | @@ -35,6 +35,12 @@ |
| 35 | 35 | - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| |
| 36 | 36 | = render :partial => "refs/tree_item", :locals => { :content => content } |
| 37 | 37 | |
| 38 | + - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme\.(md|markdown)$/i }.first | |
| 39 | + #tree-readme-holder | |
| 40 | + %h3= content.name | |
| 41 | + .readme | |
| 42 | + = markdown(encode content.data) | |
| 43 | + | |
| 38 | 44 | :javascript |
| 39 | 45 | $(function(){ |
| 40 | 46 | $('select#branch').selectmenu({style:'popup', width:200}); | ... | ... |
lib/utils.rb
| ... | ... | @@ -18,13 +18,14 @@ module Utils |
| 18 | 18 | |
| 19 | 19 | module CharEncode |
| 20 | 20 | def encode(string) |
| 21 | + return '' unless string | |
| 21 | 22 | cd = CharDet.detect(string) |
| 22 | 23 | if cd.confidence > 0.6 |
| 23 | 24 | string.force_encoding(cd.encoding) |
| 24 | 25 | end |
| 25 | 26 | string.encode("utf-8", :undef => :replace, :replace => "?", :invalid => :replace) |
| 26 | 27 | rescue |
| 27 | - "Invalid code encoding" | |
| 28 | + "Invalid Encoding" | |
| 28 | 29 | end |
| 29 | 30 | end |
| 30 | 31 | ... | ... |