Commit 31bc2b9495edcdfcc4c70c1e4d7bff715bcd57f5

Authored by Dmitriy Zaporozhets
1 parent 0a6b64e6

Fix tree css class conflict

app/assets/stylesheets/main.scss
@@ -136,7 +136,7 @@ $hover: #FDF5D9; @@ -136,7 +136,7 @@ $hover: #FDF5D9;
136 /** 136 /**
137 * Code (files list) styles. Browsing project files there 137 * Code (files list) styles. Browsing project files there
138 */ 138 */
139 -@import "tree.scss"; 139 +@import "sections/tree.scss";
140 140
141 /** 141 /**
142 * This file represent notes(comments) styles 142 * This file represent notes(comments) styles
app/assets/stylesheets/sections/tree.scss 0 → 100644
@@ -0,0 +1,232 @@ @@ -0,0 +1,232 @@
  1 +#tree-holder {
  2 + #tree-content-holder {
  3 + float:left;
  4 + width:100%;
  5 + }
  6 + #tree-readme-holder {
  7 + float:left;
  8 + width:100%;
  9 + .readme {
  10 + border:1px solid #ccc;
  11 + padding:12px;
  12 + background: #F7F7F7;
  13 +
  14 + pre {
  15 + overflow: auto;
  16 + }
  17 + }
  18 + }
  19 +
  20 + .tree_progress {
  21 + display:none;
  22 + margin:20px;
  23 + &.loading {
  24 + display:block;
  25 + }
  26 + }
  27 +
  28 +
  29 + /** FILE CONTENT VIEW **/
  30 + .view_file_content{
  31 + .old_line, .new_line {
  32 + background:#ECECEC;
  33 + color:#777;
  34 + width:15px;
  35 + float:left;
  36 + padding: 0px 10px;
  37 + border-right: 1px solid #ccc;
  38 + }
  39 + .old_line{
  40 + display:none;
  41 + }
  42 + }
  43 +
  44 + .view_file .view_file_header,
  45 + .diff_file .diff_file_header {
  46 + border-bottom: 1px solid #bbb;
  47 + background:#eee;
  48 + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf));
  49 + background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf);
  50 + background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf);
  51 + background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);
  52 + margin: 0;
  53 + font-weight: normal;
  54 + font-weight: bold;
  55 + text-align: left;
  56 + color: #666;
  57 + padding: 9px 10px;
  58 + height:18px;
  59 +
  60 + .options {
  61 + float:right;
  62 + margin-top: -5px;
  63 + }
  64 +
  65 + .file_name {
  66 + color:$style_color;
  67 + font-size:14px;
  68 + text-shadow: 0 1px 1px #fff;
  69 + small {
  70 + color:#999;
  71 + font-size:13px;
  72 + }
  73 + }
  74 + }
  75 +
  76 + .view_file {
  77 + border:1px solid #CCC;
  78 + margin-bottom:1em;
  79 +
  80 + .view_file_content {
  81 + background:#fff;
  82 + color:#514721;
  83 + font-size: 11px;
  84 + }
  85 + .view_file_content_image {
  86 + background:#eee;
  87 + text-align:center;
  88 + img {
  89 + padding:100px;
  90 + max-width:300px;
  91 + }
  92 + }
  93 + }
  94 +
  95 + td.code {
  96 + width: 100%;
  97 + .highlight {
  98 + margin-left: 55px;
  99 + overflow:auto;
  100 + overflow-y:hidden;
  101 + }
  102 + }
  103 + .highlight pre {
  104 + white-space: pre;
  105 + word-wrap:normal;
  106 + }
  107 +
  108 + table.highlighttable {
  109 + border: none;
  110 + }
  111 + body.project-page table.highlighttable td { border: none }
  112 + table.highlighttable tr:hover { background:none;}
  113 +
  114 + table.highlighttable pre{
  115 + line-height:16px !important;
  116 + font-size:12px !important;
  117 + }
  118 +
  119 + table.highlighttable .linenodiv pre {
  120 + text-align: right;
  121 + padding-right: 4px;
  122 + color:#666;
  123 + }
  124 +
  125 + #tree-slider {
  126 + @include border-radius(0);
  127 + .tree-item {
  128 + &:hover {
  129 + td { background: $hover; }
  130 + cursor:pointer;
  131 + }
  132 + }
  133 + }
  134 +
  135 + .tree-item {
  136 + .tree-item-file-name {
  137 + vertical-align:middle;
  138 + font-weight:bold;
  139 + a {
  140 + color:$style_color;
  141 + &:hover {
  142 + color:$blue_link;
  143 + }
  144 + }
  145 +
  146 + img {
  147 + position: relative;
  148 + top:-1px;
  149 + }
  150 + }
  151 + }
  152 +
  153 +
  154 + #tree-slider {
  155 + @include shade;
  156 + width:100%;
  157 +
  158 + border-color:#ccc;
  159 +
  160 + td {
  161 + padding:8px;
  162 + border-color:#f1f1f1;
  163 + background:#fafafa;
  164 + }
  165 +
  166 + tr:first-child td:first-child,
  167 + tr:first-child td:last-child {
  168 + border-radius:0;
  169 + }
  170 +
  171 + th {
  172 + border-color: #CCC;
  173 + border-bottom: 1px solid #bbb;
  174 + background:#eee;
  175 + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf));
  176 + background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf);
  177 + background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf);
  178 + background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);
  179 + }
  180 + }
  181 +
  182 + .tree-commit-link {
  183 + color:#333;
  184 + }
  185 +
  186 + #tree-content-holder .view_file{
  187 + @include shade;
  188 + }
  189 +
  190 + #tree-readme-holder .readme {
  191 + @include shade;
  192 + margin-bottom:20px;
  193 + h1, h2 {
  194 + line-height: 56px;
  195 + }
  196 + h3, h4 {
  197 + line-height: 46px;
  198 + }
  199 + }
  200 +
  201 + a.tree-commit-link {
  202 + color: #666;
  203 + &:hover {
  204 + text-decoration: underline;
  205 + }
  206 + }
  207 +
  208 +}
  209 +
  210 +.blame_file {
  211 + .view_file_content {
  212 + tr {
  213 + border-bottom: 1px solid #eee;
  214 + }
  215 + td {
  216 + padding:5px;
  217 + }
  218 + .author,
  219 + .commit {
  220 + background:#f5f5f5;
  221 + vertical-align:top;
  222 + }
  223 + .lines {
  224 + pre {
  225 + padding:0;
  226 + margin:0;
  227 + background:none;
  228 + border:none;
  229 + }
  230 + }
  231 + }
  232 +}
app/assets/stylesheets/tree.scss
@@ -1,232 +0,0 @@ @@ -1,232 +0,0 @@
1 -#tree-holder {  
2 - #tree-content-holder {  
3 - float:left;  
4 - width:100%;  
5 - }  
6 - #tree-readme-holder {  
7 - float:left;  
8 - width:100%;  
9 - .readme {  
10 - border:1px solid #ccc;  
11 - padding:12px;  
12 - background: #F7F7F7;  
13 -  
14 - pre {  
15 - overflow: auto;  
16 - }  
17 - }  
18 - }  
19 -  
20 - .tree_progress {  
21 - display:none;  
22 - margin:20px;  
23 - &.loading {  
24 - display:block;  
25 - }  
26 - }  
27 -  
28 -  
29 - /** FILE CONTENT VIEW **/  
30 - .view_file_content{  
31 - .old_line, .new_line {  
32 - background:#ECECEC;  
33 - color:#777;  
34 - width:15px;  
35 - float:left;  
36 - padding: 0px 10px;  
37 - border-right: 1px solid #ccc;  
38 - }  
39 - .old_line{  
40 - display:none;  
41 - }  
42 - }  
43 -  
44 - .view_file .view_file_header,  
45 - .diff_file .diff_file_header {  
46 - border-bottom: 1px solid #bbb;  
47 - background:#eee;  
48 - background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf));  
49 - background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf);  
50 - background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf);  
51 - background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);  
52 - margin: 0;  
53 - font-weight: normal;  
54 - font-weight: bold;  
55 - text-align: left;  
56 - color: #666;  
57 - padding: 9px 10px;  
58 - height:18px;  
59 -  
60 - .options {  
61 - float:right;  
62 - margin-top: -5px;  
63 - }  
64 -  
65 - .file_name {  
66 - color:$style_color;  
67 - font-size:14px;  
68 - text-shadow: 0 1px 1px #fff;  
69 - small {  
70 - color:#999;  
71 - font-size:13px;  
72 - }  
73 - }  
74 - }  
75 -  
76 - .view_file {  
77 - border:1px solid #CCC;  
78 - margin-bottom:1em;  
79 -  
80 - .view_file_content {  
81 - background:#fff;  
82 - color:#514721;  
83 - font-size: 11px;  
84 - }  
85 - .view_file_content_image {  
86 - background:#eee;  
87 - text-align:center;  
88 - img {  
89 - padding:100px;  
90 - max-width:300px;  
91 - }  
92 - }  
93 - }  
94 -  
95 - td.code {  
96 - width: 100%;  
97 - .highlight {  
98 - margin-left: 55px;  
99 - overflow:auto;  
100 - overflow-y:hidden;  
101 - }  
102 - }  
103 - .highlight pre {  
104 - white-space: pre;  
105 - word-wrap:normal;  
106 - }  
107 -  
108 - table.highlighttable {  
109 - border: none;  
110 - }  
111 - body.project-page table.highlighttable td { border: none }  
112 - table.highlighttable tr:hover { background:none;}  
113 -  
114 - table.highlighttable pre{  
115 - line-height:16px !important;  
116 - font-size:12px !important;  
117 - }  
118 -  
119 - table.highlighttable .linenodiv pre {  
120 - text-align: right;  
121 - padding-right: 4px;  
122 - color:#666;  
123 - }  
124 -  
125 - #tree-slider {  
126 - @include border-radius(0);  
127 - .tree-item {  
128 - &:hover {  
129 - td { background: $hover; }  
130 - cursor:pointer;  
131 - }  
132 - }  
133 - }  
134 -  
135 - .tree-item {  
136 - .tree-item-file-name {  
137 - vertical-align:middle;  
138 - font-weight:bold;  
139 - a {  
140 - color:$style_color;  
141 - &:hover {  
142 - color:$blue_link;  
143 - }  
144 - }  
145 -  
146 - img {  
147 - position: relative;  
148 - top:-1px;  
149 - }  
150 - }  
151 - }  
152 -  
153 -  
154 - #tree-slider {  
155 - @include shade;  
156 - width:100%;  
157 -  
158 - border-color:#ccc;  
159 -  
160 - td {  
161 - padding:8px;  
162 - border-color:#f1f1f1;  
163 - background:#fafafa;  
164 - }  
165 -  
166 - tr:first-child td:first-child,  
167 - tr:first-child td:last-child {  
168 - border-radius:0;  
169 - }  
170 -  
171 - th {  
172 - border-color: #CCC;  
173 - border-bottom: 1px solid #bbb;  
174 - background:#eee;  
175 - background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf));  
176 - background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf);  
177 - background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf);  
178 - background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);  
179 - }  
180 - }  
181 -  
182 - .tree-commit-link {  
183 - color:#333;  
184 - }  
185 -  
186 - #tree-content-holder .view_file{  
187 - @include shade;  
188 - }  
189 -  
190 - #tree-readme-holder .readme {  
191 - @include shade;  
192 - margin-bottom:20px;  
193 - h1, h2 {  
194 - line-height: 56px;  
195 - }  
196 - h3, h4 {  
197 - line-height: 46px;  
198 - }  
199 - }  
200 -  
201 - a.tree-commit-link {  
202 - color: #666;  
203 - &:hover {  
204 - text-decoration: underline;  
205 - }  
206 - }  
207 -  
208 -}  
209 -  
210 -.blame_file {  
211 - .view_file_content {  
212 - tr {  
213 - border-bottom: 1px solid #eee;  
214 - }  
215 - td {  
216 - padding:5px;  
217 - }  
218 - .author,  
219 - .commit {  
220 - background:#f5f5f5;  
221 - vertical-align:top;  
222 - }  
223 - .lines {  
224 - pre {  
225 - padding:0;  
226 - margin:0;  
227 - background:none;  
228 - border:none;  
229 - }  
230 - }  
231 - }  
232 -}  
app/views/refs/_tree_item.html.haml
@@ -13,10 +13,10 @@ @@ -13,10 +13,10 @@
13 - else 13 - else
14 = image_tag "file_dir.png" 14 = image_tag "file_dir.png"
15 = link_to truncate(content.name, :length => 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), :remote => :true 15 = link_to truncate(content.name, :length => 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), :remote => :true
16 - %td.cgray 16 + %td.tree_time_ago.cgray
17 = time_ago_in_words(content_commit.committed_date) 17 = time_ago_in_words(content_commit.committed_date)
18 ago 18 ago
19 - %td.commit 19 + %td.tree_commit
20 - tm = @project.team_member_by_name_or_email(content_commit.author_email, content_commit.author_name) 20 - tm = @project.team_member_by_name_or_email(content_commit.author_email, content_commit.author_name)
21 - if tm 21 - if tm
22 %strong= link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) 22 %strong= link_to "[#{tm.user_name}]", project_team_member_path(@project, tm)