summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaito <saitowu@gmail.com>2011-12-13 00:42:07 +0800
committerJeremy Mack <jmacktdkc@gmail.com>2011-12-13 13:20:45 -0500
commita39fb5fc25f2db100115e15cdca1daee80693c94 (patch)
tree039ec5fb64e70090bee0b7d2429edae02180366e
parenta1cd582c67b10abbda6c2fb2c99d8735138d33db (diff)
downloadgitlab-ce-a39fb5fc25f2db100115e15cdca1daee80693c94.tar.gz
tree view readme support
-rw-r--r--app/assets/stylesheets/projects.css.scss35
-rw-r--r--app/views/refs/_tree.html.haml8
2 files changed, 30 insertions, 13 deletions
diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss
index 025700245f5..d487e581f4f 100644
--- a/app/assets/stylesheets/projects.css.scss
+++ b/app/assets/stylesheets/projects.css.scss
@@ -67,8 +67,8 @@ a {
}
}
-.view_file .view_file_header,
-.diff_file .diff_file_header {
+.view_file .view_file_header,
+.diff_file .diff_file_header {
background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8));
background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8);
background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8);
@@ -116,7 +116,7 @@ td.code {
word-wrap:normal;
}
-table.highlighttable {
+table.highlighttable {
border: none;
background: #F7F7F7;
}
@@ -331,7 +331,7 @@ body.project-page table .commit {
border:none;
text-shadow:none;
- &.inline {
+ &.inline {
display:inline;
}
@@ -430,28 +430,28 @@ body.projects-page input.text.git-url.project_list_url { width:165px; }
body.project-page table.no-borders tr,
-body.project-page table.no-borders td{
+body.project-page table.no-borders td{
border:none;
}
-#gitlab-tabs {
+#gitlab-tabs {
.ui-tabs-nav {
border-bottom: 1px solid #DEDFE1;
- li {
+ li {
background: none;
border:none;
font-size: 16px;
margin: 0;
padding: 0;
- a {
+ a {
margin: 0;
padding: 10px 16px;
width:150px;
}
- &.ui-tabs-selected {
+ &.ui-tabs-selected {
background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8));
background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8);
background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8);
@@ -466,17 +466,28 @@ body.project-page table.no-borders td{
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
- }
- }
+ }
+ }
}
-.ajax-tab-loading {
+.ajax-tab-loading {
padding:40px;
display:none;
}
#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 */
diff --git a/app/views/refs/_tree.html.haml b/app/views/refs/_tree.html.haml
index 7400aa6735b..0fad2452a03 100644
--- a/app/views/refs/_tree.html.haml
+++ b/app/views/refs/_tree.html.haml
@@ -21,7 +21,7 @@
%th
Last commit
= link_to "history", tree.history_path, :class => "right"
-
+
- if tree.up_dir?
%tr{ :class => "tree-item", :url => tree.up_dir_path }
%td.tree-item-file-name
@@ -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});