aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2016-10-19 16:31:00 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2016-10-19 16:31:00 -0400
commit6fd7bffccd28ef83f700f9a68b34c4cda75af858 (patch)
tree6309d8fcd53ef993ef82dd50f0ad2a0820d5208d
parentd2abfa4f48b0925838590884bf45f06eeaa74440 (diff)
downloadGradeBook-6fd7bffccd28ef83f700f9a68b34c4cda75af858.tar.gz
GradeBook-6fd7bffccd28ef83f700f9a68b34c4cda75af858.zip
marking sorting column in html output
-rwxr-xr-xGradeBook_lib.tcl11
1 files changed, 8 insertions, 3 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index 59749a2..58c2ac8 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -1031,7 +1031,7 @@ proc number2letter_grade { num } {
return "NA"
}
-proc htmlGradesTableHeadersRaw { permission_list user sql_column_str hidden_columns v_array_list } {
+proc htmlGradesTableHeadersRaw { permission_list user sql_column_str hidden_columns v_array_list sort_col} {
global GradebookServerConfig
global script_name
array set permission $permission_list
@@ -1051,7 +1051,12 @@ proc htmlGradesTableHeadersRaw { permission_list user sql_column_str hidden_colu
} else {
set category [SelectColValue4User $col _Col_Category_]
}
- puts -nonewline "<th class=\"$category\"><a href=\"$script_name?action=sort&sortCol=$col\">$col</a>"
+ set sort_symbol "&darr;"; # down arrow
+ set col_text "$col"
+ if { $col eq $sort_col } {
+ set col_text "$col_text$sort_symbol"
+ }
+ puts -nonewline "<th class=\"$category\"><a href=\"$script_name?action=sort&sortCol=$col\">$col_text</a>"
# below list has action and action_label pairs
set action_list {userhidecolumn}
switch $col {
@@ -1412,7 +1417,7 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
set show_header 0
puts {<table class="gradestable" border="1">}
set v_array_list [array get v]
- htmlGradesTableHeadersRaw $permission_list $user $sql_column_str $hidden_columns $v_array_list
+ htmlGradesTableHeadersRaw $permission_list $user $sql_column_str $hidden_columns $v_array_list $sort_col
htmlFormatMaxPossibleRaw $sql_column_str $hidden_columns
puts [htmlFormatTheStatsForGradeRaw high $sql_column_str $hidden_columns]
puts [htmlFormatTheStatsForGradeRaw mean $sql_column_str $hidden_columns]