Commit a39fb5fc25f2db100115e15cdca1daee80693c94
Committed by
Jeremy Mack
1 parent
a1cd582c
Exists in
master
and in
4 other branches
tree view readme support
Showing
2 changed files
with
30 additions
and
13 deletions
Show diff stats
app/assets/stylesheets/projects.css.scss
@@ -67,8 +67,8 @@ a { | @@ -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 | background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); | 72 | background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); |
73 | background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); | 73 | background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); |
74 | background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); | 74 | background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); |
@@ -116,7 +116,7 @@ td.code { | @@ -116,7 +116,7 @@ td.code { | ||
116 | word-wrap:normal; | 116 | word-wrap:normal; |
117 | } | 117 | } |
118 | 118 | ||
119 | -table.highlighttable { | 119 | +table.highlighttable { |
120 | border: none; | 120 | border: none; |
121 | background: #F7F7F7; | 121 | background: #F7F7F7; |
122 | } | 122 | } |
@@ -331,7 +331,7 @@ body.project-page table .commit { | @@ -331,7 +331,7 @@ body.project-page table .commit { | ||
331 | border:none; | 331 | border:none; |
332 | text-shadow:none; | 332 | text-shadow:none; |
333 | 333 | ||
334 | - &.inline { | 334 | + &.inline { |
335 | display:inline; | 335 | display:inline; |
336 | } | 336 | } |
337 | 337 | ||
@@ -430,28 +430,28 @@ body.projects-page input.text.git-url.project_list_url { width:165px; } | @@ -430,28 +430,28 @@ body.projects-page input.text.git-url.project_list_url { width:165px; } | ||
430 | 430 | ||
431 | 431 | ||
432 | body.project-page table.no-borders tr, | 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 | border:none; | 434 | border:none; |
435 | } | 435 | } |
436 | 436 | ||
437 | -#gitlab-tabs { | 437 | +#gitlab-tabs { |
438 | .ui-tabs-nav { | 438 | .ui-tabs-nav { |
439 | border-bottom: 1px solid #DEDFE1; | 439 | border-bottom: 1px solid #DEDFE1; |
440 | 440 | ||
441 | - li { | 441 | + li { |
442 | background: none; | 442 | background: none; |
443 | border:none; | 443 | border:none; |
444 | font-size: 16px; | 444 | font-size: 16px; |
445 | margin: 0; | 445 | margin: 0; |
446 | padding: 0; | 446 | padding: 0; |
447 | 447 | ||
448 | - a { | 448 | + a { |
449 | margin: 0; | 449 | margin: 0; |
450 | padding: 10px 16px; | 450 | padding: 10px 16px; |
451 | width:150px; | 451 | width:150px; |
452 | } | 452 | } |
453 | 453 | ||
454 | - &.ui-tabs-selected { | 454 | + &.ui-tabs-selected { |
455 | background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); | 455 | background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); |
456 | background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); | 456 | background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); |
457 | background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); | 457 | background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); |
@@ -466,17 +466,28 @@ body.project-page table.no-borders td{ | @@ -466,17 +466,28 @@ body.project-page table.no-borders td{ | ||
466 | border-top-left-radius: 5px; | 466 | border-top-left-radius: 5px; |
467 | border-top-right-radius: 5px; | 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 | padding:40px; | 474 | padding:40px; |
475 | display:none; | 475 | display:none; |
476 | } | 476 | } |
477 | 477 | ||
478 | #tree-content-holder { float:left; width:100%; } | 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 | /* Commit Page */ | 493 | /* Commit Page */ |
app/views/refs/_tree.html.haml
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | %th | 21 | %th |
22 | Last commit | 22 | Last commit |
23 | = link_to "history", tree.history_path, :class => "right" | 23 | = link_to "history", tree.history_path, :class => "right" |
24 | - | 24 | + |
25 | - if tree.up_dir? | 25 | - if tree.up_dir? |
26 | %tr{ :class => "tree-item", :url => tree.up_dir_path } | 26 | %tr{ :class => "tree-item", :url => tree.up_dir_path } |
27 | %td.tree-item-file-name | 27 | %td.tree-item-file-name |
@@ -35,6 +35,12 @@ | @@ -35,6 +35,12 @@ | ||
35 | - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| | 35 | - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| |
36 | = render :partial => "refs/tree_item", :locals => { :content => content } | 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 | :javascript | 44 | :javascript |
39 | $(function(){ | 45 | $(function(){ |
40 | $('select#branch').selectmenu({style:'popup', width:200}); | 46 | $('select#branch').selectmenu({style:'popup', width:200}); |