##// END OF EJS Templates
main-page: fixed jumping of text in grid loading....
dan -
r4185:d325c1c9 stable
parent child Browse files
Show More
@@ -1,542 +1,553 b''
1 1
2 2 // tables.less
3 3 // For use in RhodeCode application tables;
4 4 // see style guide documentation for guidelines.
5 5
6 6 // TABLES
7 7
8 8 .rctable,
9 9 table.rctable,
10 10 table.dataTable {
11 11 clear:both;
12 12 width: 100%;
13 13 margin: 0 auto @padding;
14 14 padding: 0;
15 15 vertical-align: baseline;
16 16 line-height:1.5em;
17 17 border: none;
18 18 outline: none;
19 19 border-collapse: collapse;
20 20 border-spacing: 0;
21 21 color: @grey2;
22 22
23 23 b {
24 24 font-weight: normal;
25 25 }
26 26
27 27 em {
28 28 font-weight: bold;
29 29 font-style: normal;
30 30 }
31 31
32 32 .td-user {
33 33 .rc-user {
34 34 white-space: nowrap;
35 35 }
36 36 }
37 37
38 38 .td-email {
39 39 white-space: nowrap;
40 40 }
41 41
42 42 th,
43 43 td {
44 44 height: auto;
45 45 max-width: 20%;
46 46 padding: .65em 0 .65em 1em;
47 47 vertical-align: middle;
48 48 border-bottom: @border-thickness solid @grey5;
49 49 white-space: normal;
50 50
51 51 &.td-radio,
52 52 &.td-checkbox {
53 53 padding-right: 0;
54 54 text-align: center;
55 55
56 56 input {
57 57 margin: 0 1em;
58 58 }
59 59 }
60 60
61 61 &.truncate-wrap {
62 62 white-space: nowrap !important;
63 63 }
64 64
65 65 pre {
66 66 margin: 0;
67 67 }
68 68
69 69 .show_more {
70 70 height: inherit;
71 71 }
72 72 }
73 73
74 74 .expired td {
75 75 background-color: @grey7;
76 76 }
77 77 .inactive td {
78 78 background-color: @grey6;
79 79 }
80 80 th {
81 81 text-align: left;
82 82 font-weight: @text-semibold-weight;
83 83 font-family: @text-semibold;
84 84 }
85 85
86 86 .hl {
87 87 td {
88 88 background-color: lighten(@alert4,25%);
89 89 }
90 90 }
91 91
92 92 // Special Data Cell Types
93 93 // See style guide for desciptions and examples.
94 94
95 95 td {
96 96
97 97 &.user {
98 98 padding-left: 1em;
99 99 }
100 100
101 101 &.td-rss {
102 102 width: 20px;
103 103 min-width: 0;
104 104 margin: 0;
105 105 }
106 106
107 107 &.quick_repo_menu {
108 108 width: 15px;
109 109 text-align: center;
110 110
111 111 &:hover {
112 112 background-color: @grey5;
113 113 }
114 114 }
115 115
116 116 &.td-icon {
117 117 min-width: 20px;
118 118 width: 20px;
119 119 }
120 120
121 121 &.td-hash {
122 122 min-width: 80px;
123 123 width: 200px;
124 124
125 125 .obsolete {
126 126 text-decoration: line-through;
127 127 color: lighten(@grey2,25%);
128 128 }
129 129 }
130 130
131 131 &.td-sha {
132 132 white-space: nowrap;
133 133 }
134 134
135 135 &.td-graphbox {
136 136 width: 100px;
137 137 max-width: 100px;
138 138 min-width: 100px;
139 139 }
140 140
141 141 &.td-time {
142 142 width: 160px;
143 143 white-space: nowrap;
144 144 }
145 145
146 146 &.annotate{
147 147 padding-right: 0;
148 148
149 149 div.annotatediv{
150 150 margin: 0 0.7em;
151 151 }
152 152 }
153 153
154 154 &.tags-col {
155 155 padding-right: 0;
156 156 }
157 157
158 158 &.td-description {
159 159 min-width: 350px;
160 160
161 161 &.truncate, .truncate-wrap {
162 162 white-space: nowrap;
163 163 overflow: hidden;
164 164 text-overflow: ellipsis;
165 165 max-width: 350px;
166 166 }
167 167 }
168 168
169 169 &.td-grid-name {
170 170 white-space: nowrap;
171 171 min-width: 300px;
172 172 }
173 173
174 174 &.td-componentname {
175 175 white-space: nowrap;
176 176 }
177 177
178 178 &.td-name {
179 179
180 180 }
181 181
182 182 &.td-journalaction {
183 183 min-width: 300px;
184 184
185 185 .journal_action_params {
186 186 // waiting for feedback
187 187 }
188 188 }
189 189
190 190 &.td-active {
191 191 padding-left: .65em;
192 192 }
193 193
194 194 &.td-issue-tracker-name {
195 195 width: 180px;
196 196 input {
197 197 width: 180px;
198 198 }
199 199
200 200 }
201 201
202 202 &.td-issue-tracker-regex {
203 203 white-space: nowrap;
204 204
205 205 min-width: 300px;
206 206 input {
207 207 min-width: 300px;
208 208 }
209 209
210 210 }
211 211
212 212 &.td-url {
213 213 white-space: nowrap;
214 214 }
215 215
216 216 &.td-comments {
217 217 min-width: 3em;
218 218 }
219 219
220 220 &.td-buttons {
221 221 padding: .3em 0;
222 222 }
223 223 &.td-align-top {
224 224 vertical-align: text-top
225 225 }
226 226 &.td-action {
227 227 // this is for the remove/delete/edit buttons
228 228 padding-right: 0;
229 229 min-width: 95px;
230 230 text-transform: capitalize;
231 231
232 232 i {
233 233 display: none;
234 234 }
235 235 }
236 236
237 237 // TODO: lisa: this needs to be cleaned up with the buttons
238 238 .grid_edit,
239 239 .grid_delete {
240 240 display: inline-block;
241 241 margin: 0 @padding/3 0 0;
242 242 font-family: @text-light;
243 243
244 244 i {
245 245 display: none;
246 246 }
247 247 }
248 248
249 249 .grid_edit + .grid_delete {
250 250 border-left: @border-thickness solid @grey5;
251 251 padding-left: @padding/2;
252 252 }
253 253
254 254 &.td-compare {
255 255
256 256 input {
257 257 margin-right: 1em;
258 258 }
259 259
260 260 .compare-radio-button {
261 261 margin: 0 1em 0 0;
262 262 }
263 263
264 264
265 265 }
266 266
267 267 &.td-tags {
268 268 padding: .5em 1em .5em 0;
269 269 width: 140px;
270 270
271 271 .tag {
272 272 margin: 1px;
273 273 float: left;
274 274 }
275 275 }
276 276
277 277 .icon-svn, .icon-hg, .icon-git {
278 278 font-size: 1.4em;
279 279 }
280 280
281 281 &.collapse_commit,
282 282 &.expand_commit {
283 283 padding-right: 0;
284 284 padding-left: 1em;
285 285 cursor: pointer;
286 286 width: 20px;
287 287 }
288 288 }
289 289
290 290 .perm_admin_row {
291 291 color: @grey4;
292 292 background-color: @grey6;
293 293 }
294 294
295 295 .noborder {
296 296 border: none;
297 297
298 298 td {
299 299 border: none;
300 300 }
301 301 }
302 302 }
303 303 .rctable.audit-log {
304 304 td {
305 305 vertical-align: top;
306 306 }
307 307 }
308 308
309 309 // TRUNCATING
310 310 // TODO: lisaq: should this possibly be moved out of tables.less?
311 311 // for truncated text
312 312 // used inside of table cells and in code block headers
313 313 .truncate-wrap {
314 314 white-space: nowrap !important;
315 315
316 316 //truncated text
317 317 .truncate {
318 318 max-width: 450px;
319 319 width: 300px;
320 320 overflow: hidden;
321 321 text-overflow: ellipsis;
322 322 -o-text-overflow: ellipsis;
323 323 -ms-text-overflow: ellipsis;
324 324
325 325 &.autoexpand {
326 326 width: 120px;
327 327 margin-right: 200px;
328 328 }
329 329 }
330 330 &:hover .truncate.autoexpand {
331 331 overflow: visible;
332 332 }
333 333
334 334 .tags-truncate {
335 335 width: 150px;
336 336 height: 22px;
337 337 overflow: hidden;
338 338
339 339 .tag {
340 340 display: inline-block;
341 341 }
342 342
343 343 &.truncate {
344 344 height: 22px;
345 345 max-height:2em;
346 346 width: 140px;
347 347 }
348 348 }
349 349 }
350 350
351 351 .apikeys_wrap {
352 352 margin-bottom: @padding;
353 353
354 354 table.rctable td:first-child {
355 355 width: 340px;
356 356 }
357 357 }
358 358
359 359
360 360
361 361 // SPECIAL CASES
362 362
363 363 // Repository Followers
364 364 table.rctable.followers_data {
365 365 width: 75%;
366 366 margin: 0;
367 367 }
368 368
369 369 // Repository List
370 370 // Group Members List
371 371 table.rctable.group_members,
372 372 table#repo_list_table {
373 373 min-width: 600px;
374 374 }
375 375
376 #no_grid_data {
377 text-align: center;
378 }
379
380 #grid_data_loading {
381 text-align: center;
382 font-weight: 600;
383 font-size: 16px;
384 padding: 80px 20px;
385 }
386
376 387 // Keyboard mappings
377 388 table.keyboard-mappings {
378 389 th {
379 390 text-align: left;
380 391 font-weight: @text-semibold-weight;
381 392 font-family: @text-semibold;
382 393 }
383 394 }
384 395
385 396 // Branches, Tags, and Bookmarks
386 397 #obj_list_table.dataTable {
387 398 td.td-time {
388 399 padding-right: 1em;
389 400 }
390 401 }
391 402
392 403 // User Admin
393 404 .rctable.useremails,
394 405 .rctable.account_emails {
395 406 .tag,
396 407 .btn {
397 408 float: right;
398 409 }
399 410 .btn { //to line up with tags
400 411 margin-right: 1.65em;
401 412 }
402 413 }
403 414
404 415 // User List
405 416 #user_list_table {
406 417
407 418 td.td-user {
408 419 min-width: 100px;
409 420 }
410 421 }
411 422
412 423 // Pull Request List Table
413 424 #pull_request_list_table.dataTable {
414 425
415 426 //TODO: lisa: This needs to be removed once the description is adjusted
416 427 // for using an expand_commit button (see issue 765)
417 428 td {
418 429 vertical-align: middle;
419 430 }
420 431 }
421 432
422 433 // Settings (no border)
423 434 table.rctable.dl-settings {
424 435 td {
425 436 border: none;
426 437 vertical-align: baseline;
427 438 }
428 439 }
429 440
430 441
431 442 // Statistics
432 443 table.trending_language_tbl {
433 444 width: 100%;
434 445 line-height: 1em;
435 446
436 447 td div {
437 448 overflow: visible;
438 449 }
439 450 }
440 451
441 452 .trending_language_tbl, .trending_language_tbl td {
442 453 border: 0;
443 454 margin: 0;
444 455 padding: 0;
445 456 background: transparent;
446 457 }
447 458
448 459 .trending_language_tbl, .trending_language_tbl tr {
449 460 border-spacing: 0 3px;
450 461 }
451 462
452 463 .trending_language {
453 464 position: relative;
454 465 overflow: hidden;
455 466 color: @text-color;
456 467 width: 400px;
457 468
458 469 .lang-bar {
459 470 z-index: 1;
460 471 overflow: hidden;
461 472 background-color: @rcblue;
462 473 color: #FFF;
463 474 text-decoration: none;
464 475 }
465 476
466 477 }
467 478
468 479 // Changesets
469 480 #changesets.rctable {
470 481 th {
471 482 padding: 0 1em 0.65em 0;
472 483 }
473 484
474 485 // td must be fixed height for graph
475 486 td {
476 487 height: 32px;
477 488 padding: 0 1em 0 0;
478 489 vertical-align: middle;
479 490 white-space: nowrap;
480 491
481 492 &.td-description {
482 493 white-space: normal;
483 494 }
484 495
485 496 &.expand_commit {
486 497 padding-right: 0;
487 498 cursor: pointer;
488 499 width: 20px;
489 500 }
490 501 }
491 502 }
492 503
493 504 // Compare
494 505 table.compare_view_commits {
495 506 margin-top: @space;
496 507
497 508 td.td-time {
498 509 padding-left: .5em;
499 510 }
500 511
501 512 // special case to not show hover actions on hidden indicator
502 513 tr.compare_select_hidden:hover {
503 514 cursor: inherit;
504 515
505 516 td {
506 517 background-color: inherit;
507 518 }
508 519 }
509 520
510 521 tr:hover {
511 522 cursor: pointer;
512 523
513 524 td {
514 525 background-color: lighten(@alert4,25%);
515 526 }
516 527 }
517 528
518 529
519 530 }
520 531
521 532 .file_history {
522 533 td.td-actions {
523 534 text-align: right;
524 535 }
525 536 }
526 537
527 538
528 539 // Gist List
529 540 #gist_list_table {
530 541 td {
531 542 vertical-align: middle;
532 543
533 544 div{
534 545 display: inline-block;
535 546 vertical-align: middle;
536 547 }
537 548
538 549 img{
539 550 vertical-align: middle;
540 551 }
541 552 }
542 553 }
@@ -1,223 +1,231 b''
1 1 <%inherit file="/base/base.mako"/>
2 2
3 3
4 4 <%def name="menu_bar_subnav()">
5 5 % if c.repo_group:
6 6 ${self.repo_group_menu(active='home')}
7 7 % endif
8 8 </%def>
9 9
10 10
11 11 <%def name="main()">
12 12 <div class="box">
13 13 <!-- box / title -->
14 14 <div class="title">
15 15
16 16 </div>
17
17 18 <!-- end box / title -->
18 19 <div id="no_grid_data" class="table" style="display: none">
19 <h2 class="no-object-border">
20 <h2>
20 21 ${_('No repositories or repositories groups exists here.')}
21 22 </h2>
22 23 </div>
23 24
25 <div id="grid_data_loading" class="table" style="display: none">
26 <i class="icon-spin animate-spin"></i>
27 ${_('loading...')}
28 </div>
29
24 30 <div class="table">
25 <div id="groups_list_wrap" style="min-height: 200px;">
31 <div id="groups_list_wrap" style="min-height: 200px;display: none">
26 32 <table id="group_list_table" class="display" style="width: 100%;"></table>
27 33 </div>
28 34 </div>
29 35
30 36 <div class="table">
31 <div id="repos_list_wrap" style="min-height: 200px;">
37 <div id="repos_list_wrap" style="min-height: 200px;display: none">
32 38 <table id="repo_list_table" class="display" style="width: 100%;"></table>
33 39 </div>
34 40 </div>
35 41
36 42 </div>
43
37 44 <script>
38 45 $(document).ready(function () {
46 var noRepoData = null;
47 var noGroupData = null;
48 var $gridDataLoading = $('#grid_data_loading');
39 49
40 // repo group list
50 // global show loading of hidden grids
51 $(document).on('preInit.dt', function (e, settings) {
52 $gridDataLoading.show();
53 });
54
55 ## repo group list
41 56 var $groupListTable = $('#group_list_table');
42 57
58 $groupListTable.on('xhr.dt', function (e, settings, json, xhr) {
59 $gridDataLoading.hide();
60 });
43 61 $groupListTable.DataTable({
44 62 processing: true,
45 63 serverSide: true,
46 64 ajax: {
47 65 "url": "${h.route_path('main_page_repo_groups_data')}",
48 66 "data": function (d) {
49 67 % if c.repo_group:
50 68 d.repo_group_id = ${c.repo_group.group_id}
51 69 % endif
52 70 }
53 71 },
54 72 dom: 'rtp',
55 73 pageLength: ${c.visual.dashboard_items},
56 74 order: [[0, "asc"]],
57 75 columns: [
58 76 {
59 77 data: {
60 78 "_": "name",
61 79 "sort": "name"
62 80 }, title: "${_('Name')}", className: "truncate-wrap td-grid-name"
63 81 },
64 82 {
65 83 data: 'menu', "bSortable": false, className: "quick_repo_menu"
66 84 },
67 85 {
68 86 data: {
69 87 "_": "desc",
70 88 "sort": "desc"
71 89 }, title: "${_('Description')}", className: "td-description"
72 90 },
73 91 {
74 92 data: {
75 93 "_": "last_change",
76 94 "sort": "last_change",
77 95 "type": Number
78 96 }, title: "${_('Last Change')}", className: "td-time"
79 97 },
80 98 {
81 99 data: {
82 100 "_": "last_changeset",
83 101 "sort": "last_changeset_raw",
84 102 "type": Number
85 103 }, title: "", className: "td-hash", orderable: false
86 104 },
87 105 {
88 106 data: {
89 107 "_": "owner",
90 108 "sort": "owner"
91 109 }, title: "${_('Owner')}", className: "td-user"
92 110 }
93 111 ],
94 112 language: {
95 113 paginate: DEFAULT_GRID_PAGINATION,
96 114 sProcessing: _gettext('loading...'),
97 115 emptyTable: _gettext("No repository groups present.")
98 116 },
99 117 "drawCallback": function (settings, json) {
118
100 119 // hide grid if it's empty
101 120 if (settings.fnRecordsDisplay() === 0) {
102 $('#groups_list_wrap').hide();
121 noGroupData = true;
103 122 // both hidden, show no-data
104 if ($('#repos_list_wrap').is(':hidden')) {
123 if (noRepoData === true) {
105 124 $('#no_grid_data').show();
106 125 }
107 126 } else {
108 127 $('#groups_list_wrap').show();
109 128 }
110 129
111 130 timeagoActivate();
112 131 tooltipActivate();
113 132 quick_repo_menu();
114 133 // hide pagination for single page
115 134 if (settings._iDisplayLength >= settings.fnRecordsDisplay()) {
116 135 $(settings.nTableWrapper).find('.dataTables_paginate').hide();
117 136 }
118 137
119 138 },
120 139 });
121 140
122 $groupListTable.on('xhr.dt', function (e, settings, json, xhr) {
123 $groupListTable.css('opacity', 1);
124 });
125 141
126 $groupListTable.on('preXhr.dt', function (e, settings, data) {
127 $groupListTable.css('opacity', 0.3);
128 });
129
130
131 ## // repo list
142 ## repo list
132 143 var $repoListTable = $('#repo_list_table');
133 144
145 $repoListTable.on('xhr.dt', function (e, settings, json, xhr) {
146 $gridDataLoading.hide();
147 });
134 148 $repoListTable.DataTable({
135 149 processing: true,
136 150 serverSide: true,
137 151 ajax: {
138 152 "url": "${h.route_path('main_page_repos_data')}",
139 153 "data": function (d) {
140 154 % if c.repo_group:
141 155 d.repo_group_id = ${c.repo_group.group_id}
142 156 % endif
143 157 }
144 158 },
145 159 order: [[0, "asc"]],
146 160 dom: 'rtp',
147 161 pageLength: ${c.visual.dashboard_items},
148 162 columns: [
149 163 {
150 164 data: {
151 165 "_": "name",
152 166 "sort": "name"
153 167 }, title: "${_('Name')}", className: "truncate-wrap td-grid-name"
154 168 },
155 169 {
156 170 data: 'menu', "bSortable": false, className: "quick_repo_menu"
157 171 },
158 172 {
159 173 data: {
160 174 "_": "desc",
161 175 "sort": "desc"
162 176 }, title: "${_('Description')}", className: "td-description"
163 177 },
164 178 {
165 179 data: {
166 180 "_": "last_change",
167 181 "sort": "last_change",
168 182 "type": Number
169 183 }, title: "${_('Last Change')}", className: "td-time"
170 184 },
171 185 {
172 186 data: {
173 187 "_": "last_changeset",
174 188 "sort": "last_changeset_raw",
175 189 "type": Number
176 190 }, title: "${_('Commit')}", className: "td-hash", orderable: false
177 191 },
178 192 {
179 193 data: {
180 194 "_": "owner",
181 195 "sort": "owner"
182 196 }, title: "${_('Owner')}", className: "td-user"
183 197 }
184 198 ],
185 199 language: {
186 200 paginate: DEFAULT_GRID_PAGINATION,
187 201 sProcessing: _gettext('loading...'),
188 202 emptyTable: _gettext("No repositories present.")
189 203 },
190 204 "drawCallback": function (settings, json) {
205
191 206 // hide grid if it's empty
192 207 if (settings.fnRecordsDisplay() == 0) {
193 $('#repos_list_wrap').hide()
208 noRepoData = true;
209
194 210 // both hidden, show no-data
195 if ($('#groups_list_wrap').is(':hidden')) {
211 if (noGroupData === true) {
196 212 $('#no_grid_data').show()
197 213 }
198 214 } else {
199 215 $('#repos_list_wrap').show()
200 216 }
201 217
202 218 timeagoActivate();
203 219 tooltipActivate();
204 220 quick_repo_menu();
205 221 // hide pagination for single page
206 222 if (settings._iDisplayLength >= settings.fnRecordsDisplay()) {
207 223 $(settings.nTableWrapper).find('.dataTables_paginate').hide();
208 224 }
209 225
210 226 },
211 227 });
212 228
213 $repoListTable.on('xhr.dt', function (e, settings, json, xhr) {
214 $repoListTable.css('opacity', 1);
215 });
216
217 $repoListTable.on('preXhr.dt', function (e, settings, data) {
218 $repoListTable.css('opacity', 0.3);
219 });
220
221 229 });
222 230 </script>
223 231 </%def>
General Comments 0
You need to be logged in to leave comments. Login now