Skip to content
Browse files

Project error overview: tablesorter added

  • Loading branch information...
1 parent 785639a commit c0caf8155c3f6ac3e50810d3ae95771aa63a3888 @yvesvanbroekhoven yvesvanbroekhoven committed Apr 30, 2010
View
13 app/styles/lib/base.sass
@@ -163,17 +163,22 @@ body
&.environment
:width 1000px
- &.projects, &.errors, &.occurrences
- :cursor pointer
-
th
:text-transform uppercase
:font-weight bold
:font-size 10px
- th span
+ th.sortable span
+ :padding-right 10px
:border-bottom 1px solid
:border-color= !grey_light
+ :cursor pointer
+
+ th.headerSortUp span
+ :background url(/images/backgrounds/bg-sortable-arrow-up.gif) no-repeat right center
+
+ th.headerSortDown span
+ :background url(/images/backgrounds/bg-sortable-arrow-down.gif) no-repeat right center
td, th
:padding 8px
View
2 app/views/errors/show.html.haml
@@ -18,7 +18,7 @@
%br
= will_paginate occurences
- %table.table.occurrences
+ %table.table.occurrences.sortable
=render occurences
= will_paginate occurences
View
6 app/views/projects/show.html.haml
@@ -1,16 +1,16 @@
- sidebar_blocks[:members] = true
- sidebar_blocks[:api_key] = true
-%table.errors
+%table.errors.sortable
%thead
%tr
%th.select
= check_box_tag 'selectAll'
%th.label
%span label
- %th
+ %th.sortable
%span error
- %th{ :class => "count {sorter: 'digit'}" }
+ %th.count.sortable
%span count
%tbody
- unless open_errors.empty?
View
2 app/views/shared/_assets.html.haml
@@ -1,2 +1,2 @@
= stylesheet_link_tag 'http://jquery-ui.googlecode.com/svn/tags/latest/themes/base/jquery-ui.css', 'application'
-= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.autoSuggest.minified.js', 'jquery.clearfield.packed.js', 'application.js'
+= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.autoSuggest.minified.js', 'jquery.tablesorter.min.js', 'jquery.clearfield.packed.js', 'application.js'
View
BIN public/images/backgrounds/bg-sortable-arrow-down.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/images/backgrounds/bg-sortable-arrow-up.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
32 public/javascripts/application.js
@@ -21,6 +21,9 @@ var validateEmail = (function(address){
!(reg.test(address) == false);
});
+/*
+ * DOM Ready
+ */
$(document).ready(function() {
var header = $('#header'),
footer = $('#footer'),
@@ -114,16 +117,23 @@ $(document).ready(function() {
}
return false;
});
-
- /*
- * Clearfield
- */
+
+ /*
+ * Clearfield
+ */
$('.clear-field').clearField();
-
- $('table.projects a, table.errors a, table.occurrences a').each(function(){
- var a = $(this),
- row = a.parent('td');
- $(row).click(function(){ window.location.href = a.attr('href'); });
- })
-
+
+
+ /*
+ * Table sorter
+ */
+ $("table.sortable").tablesorter({textExtraction: 'complex'});
+ $("table.sortable th").filter(function(idx){
+ if ($(this).hasClass('sortable')) {
+ return false;
+ } else {
+ return $(this);
+ }
+ }).unbind('click');
+
}); // End DOM ready
View
12 public/stylesheets/application.css
@@ -202,15 +202,19 @@ body {
margin: 0 0 10px 0; }
#container #content table.environment {
width: 1000px; }
- #container #content table.projects, #container #content table.errors, #container #content table.occurrences {
- cursor: pointer; }
#container #content table th {
text-transform: uppercase;
font-weight: bold;
font-size: 10px; }
- #container #content table th span {
+ #container #content table th.sortable span {
+ padding-right: 10px;
border-bottom: 1px solid;
- border-color: #b2b5ae; }
+ border-color: #b2b5ae;
+ cursor: pointer; }
+ #container #content table th.headerSortUp span {
+ background: url(/images/backgrounds/bg-sortable-arrow-up.gif) no-repeat right center; }
+ #container #content table th.headerSortDown span {
+ background: url(/images/backgrounds/bg-sortable-arrow-down.gif) no-repeat right center; }
#container #content table td, #container #content table th {
padding: 8px;
word-wrap: break-word; }

0 comments on commit c0caf81

Please sign in to comment.
Something went wrong with that request. Please try again.