diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index bff24dd..5f13f30 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -136,7 +136,7 @@ $hover: #FDF5D9; /** * Code (files list) styles. Browsing project files there */ -@import "tree.scss"; +@import "sections/tree.scss"; /** * This file represent notes(comments) styles diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss new file mode 100644 index 0000000..912c63e --- /dev/null +++ b/app/assets/stylesheets/sections/tree.scss @@ -0,0 +1,232 @@ +#tree-holder { + #tree-content-holder { + float:left; + width:100%; + } + #tree-readme-holder { + float:left; + width:100%; + .readme { + border:1px solid #ccc; + padding:12px; + background: #F7F7F7; + + pre { + overflow: auto; + } + } + } + + .tree_progress { + display:none; + margin:20px; + &.loading { + display:block; + } + } + + + /** FILE CONTENT VIEW **/ + .view_file_content{ + .old_line, .new_line { + background:#ECECEC; + color:#777; + width:15px; + float:left; + padding: 0px 10px; + border-right: 1px solid #ccc; + } + .old_line{ + display:none; + } + } + + .view_file .view_file_header, + .diff_file .diff_file_header { + border-bottom: 1px solid #bbb; + background:#eee; + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf)); + background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf); + background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf); + background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf); + margin: 0; + font-weight: normal; + font-weight: bold; + text-align: left; + color: #666; + padding: 9px 10px; + height:18px; + + .options { + float:right; + margin-top: -5px; + } + + .file_name { + color:$style_color; + font-size:14px; + text-shadow: 0 1px 1px #fff; + small { + color:#999; + font-size:13px; + } + } + } + + .view_file { + border:1px solid #CCC; + margin-bottom:1em; + + .view_file_content { + background:#fff; + color:#514721; + font-size: 11px; + } + .view_file_content_image { + background:#eee; + text-align:center; + img { + padding:100px; + max-width:300px; + } + } + } + + td.code { + width: 100%; + .highlight { + margin-left: 55px; + overflow:auto; + overflow-y:hidden; + } + } + .highlight pre { + white-space: pre; + word-wrap:normal; + } + + table.highlighttable { + border: none; + } + body.project-page table.highlighttable td { border: none } + table.highlighttable tr:hover { background:none;} + + table.highlighttable pre{ + line-height:16px !important; + font-size:12px !important; + } + + table.highlighttable .linenodiv pre { + text-align: right; + padding-right: 4px; + color:#666; + } + + #tree-slider { + @include border-radius(0); + .tree-item { + &:hover { + td { background: $hover; } + cursor:pointer; + } + } + } + + .tree-item { + .tree-item-file-name { + vertical-align:middle; + font-weight:bold; + a { + color:$style_color; + &:hover { + color:$blue_link; + } + } + + img { + position: relative; + top:-1px; + } + } + } + + + #tree-slider { + @include shade; + width:100%; + + border-color:#ccc; + + td { + padding:8px; + border-color:#f1f1f1; + background:#fafafa; + } + + tr:first-child td:first-child, + tr:first-child td:last-child { + border-radius:0; + } + + th { + border-color: #CCC; + border-bottom: 1px solid #bbb; + background:#eee; + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf)); + background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf); + background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf); + background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf); + } + } + + .tree-commit-link { + color:#333; + } + + #tree-content-holder .view_file{ + @include shade; + } + + #tree-readme-holder .readme { + @include shade; + margin-bottom:20px; + h1, h2 { + line-height: 56px; + } + h3, h4 { + line-height: 46px; + } + } + + a.tree-commit-link { + color: #666; + &:hover { + text-decoration: underline; + } + } + +} + +.blame_file { + .view_file_content { + tr { + border-bottom: 1px solid #eee; + } + td { + padding:5px; + } + .author, + .commit { + background:#f5f5f5; + vertical-align:top; + } + .lines { + pre { + padding:0; + margin:0; + background:none; + border:none; + } + } + } +} diff --git a/app/assets/stylesheets/tree.scss b/app/assets/stylesheets/tree.scss deleted file mode 100644 index 912c63e..0000000 --- a/app/assets/stylesheets/tree.scss +++ /dev/null @@ -1,232 +0,0 @@ -#tree-holder { - #tree-content-holder { - float:left; - width:100%; - } - #tree-readme-holder { - float:left; - width:100%; - .readme { - border:1px solid #ccc; - padding:12px; - background: #F7F7F7; - - pre { - overflow: auto; - } - } - } - - .tree_progress { - display:none; - margin:20px; - &.loading { - display:block; - } - } - - - /** FILE CONTENT VIEW **/ - .view_file_content{ - .old_line, .new_line { - background:#ECECEC; - color:#777; - width:15px; - float:left; - padding: 0px 10px; - border-right: 1px solid #ccc; - } - .old_line{ - display:none; - } - } - - .view_file .view_file_header, - .diff_file .diff_file_header { - border-bottom: 1px solid #bbb; - background:#eee; - background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf)); - background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf); - background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf); - background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf); - margin: 0; - font-weight: normal; - font-weight: bold; - text-align: left; - color: #666; - padding: 9px 10px; - height:18px; - - .options { - float:right; - margin-top: -5px; - } - - .file_name { - color:$style_color; - font-size:14px; - text-shadow: 0 1px 1px #fff; - small { - color:#999; - font-size:13px; - } - } - } - - .view_file { - border:1px solid #CCC; - margin-bottom:1em; - - .view_file_content { - background:#fff; - color:#514721; - font-size: 11px; - } - .view_file_content_image { - background:#eee; - text-align:center; - img { - padding:100px; - max-width:300px; - } - } - } - - td.code { - width: 100%; - .highlight { - margin-left: 55px; - overflow:auto; - overflow-y:hidden; - } - } - .highlight pre { - white-space: pre; - word-wrap:normal; - } - - table.highlighttable { - border: none; - } - body.project-page table.highlighttable td { border: none } - table.highlighttable tr:hover { background:none;} - - table.highlighttable pre{ - line-height:16px !important; - font-size:12px !important; - } - - table.highlighttable .linenodiv pre { - text-align: right; - padding-right: 4px; - color:#666; - } - - #tree-slider { - @include border-radius(0); - .tree-item { - &:hover { - td { background: $hover; } - cursor:pointer; - } - } - } - - .tree-item { - .tree-item-file-name { - vertical-align:middle; - font-weight:bold; - a { - color:$style_color; - &:hover { - color:$blue_link; - } - } - - img { - position: relative; - top:-1px; - } - } - } - - - #tree-slider { - @include shade; - width:100%; - - border-color:#ccc; - - td { - padding:8px; - border-color:#f1f1f1; - background:#fafafa; - } - - tr:first-child td:first-child, - tr:first-child td:last-child { - border-radius:0; - } - - th { - border-color: #CCC; - border-bottom: 1px solid #bbb; - background:#eee; - background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf)); - background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf); - background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf); - background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf); - } - } - - .tree-commit-link { - color:#333; - } - - #tree-content-holder .view_file{ - @include shade; - } - - #tree-readme-holder .readme { - @include shade; - margin-bottom:20px; - h1, h2 { - line-height: 56px; - } - h3, h4 { - line-height: 46px; - } - } - - a.tree-commit-link { - color: #666; - &:hover { - text-decoration: underline; - } - } - -} - -.blame_file { - .view_file_content { - tr { - border-bottom: 1px solid #eee; - } - td { - padding:5px; - } - .author, - .commit { - background:#f5f5f5; - vertical-align:top; - } - .lines { - pre { - padding:0; - margin:0; - background:none; - border:none; - } - } - } -} diff --git a/app/views/refs/_tree_item.html.haml b/app/views/refs/_tree_item.html.haml index fe2f729..45ea537 100644 --- a/app/views/refs/_tree_item.html.haml +++ b/app/views/refs/_tree_item.html.haml @@ -13,10 +13,10 @@ - else = image_tag "file_dir.png" = link_to truncate(content.name, :length => 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), :remote => :true - %td.cgray + %td.tree_time_ago.cgray = time_ago_in_words(content_commit.committed_date) ago - %td.commit + %td.tree_commit - tm = @project.team_member_by_name_or_email(content_commit.author_email, content_commit.author_name) - if tm %strong= link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) -- libgit2 0.21.2