From 6fd7bffccd28ef83f700f9a68b34c4cda75af858 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Wed, 19 Oct 2016 16:31:00 -0400 Subject: marking sorting column in html output --- GradeBook_lib.tcl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'GradeBook_lib.tcl') 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 "$col" + set sort_symbol "↓"; # down arrow + set col_text "$col" + if { $col eq $sort_col } { + set col_text "$col_text$sort_symbol" + } + puts -nonewline "$col_text" # 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 {} 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] -- cgit v1.2.3