Index: openacs-4/packages/general-comments/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/Attic/index-oracle.xql,v diff -u -r1.2 -r1.2.14.1 --- openacs-4/packages/general-comments/www/index-oracle.xql 24 Jan 2005 00:29:38 -0000 1.2 +++ openacs-4/packages/general-comments/www/index-oracle.xql 8 Aug 2014 12:29:13 -0000 1.2.14.1 @@ -22,7 +22,7 @@ r.revision_id = content_item.get_latest_revision(g.comment_id) and o.creation_user = :user_id [ad_dimensional_sql $dimensional] - [ad_order_by_from_sort_spec $orderby $table_def] + [template::list::orderby_clause -orderby -name comments_list] Index: openacs-4/packages/general-comments/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/Attic/index-postgresql.xql,v diff -u -r1.3 -r1.3.14.1 --- openacs-4/packages/general-comments/www/index-postgresql.xql 24 Jan 2005 00:29:38 -0000 1.3 +++ openacs-4/packages/general-comments/www/index-postgresql.xql 8 Aug 2014 12:29:13 -0000 1.3.14.1 @@ -22,8 +22,7 @@ r.revision_id = i.latest_revision and o.creation_user = :user_id [ad_dimensional_sql $dimensional]) as unordered - [ad_order_by_from_sort_spec $orderby $table_def] - + [template::list::orderby_clause -orderby -name comments_list] Index: openacs-4/packages/general-comments/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/index.adp,v diff -u -r1.5.20.1 -r1.5.20.2 --- openacs-4/packages/general-comments/www/index.adp 11 Sep 2013 18:40:27 -0000 1.5.20.1 +++ openacs-4/packages/general-comments/www/index.adp 8 Aug 2014 12:29:13 -0000 1.5.20.2 @@ -8,9 +8,5 @@

@dimensional_bar;noquote@

-@comments_table;noquote@ - - - - + Index: openacs-4/packages/general-comments/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/index.tcl,v diff -u -r1.7.14.1 -r1.7.14.2 --- openacs-4/packages/general-comments/www/index.tcl 6 Sep 2013 12:06:51 -0000 1.7.14.1 +++ openacs-4/packages/general-comments/www/index.tcl 8 Aug 2014 12:29:13 -0000 1.7.14.2 @@ -7,8 +7,10 @@ @author Pascal Scheffers (pascal@scheffers.net) @creation-date 2000-10-12 @cvs-id $Id$ -} { - {orderby {pretty_date*} } +} -query { + {orderby:optional} + {approval "any"} + {modified "any"} } -properties { page_title:onevalue context:onevalue @@ -43,25 +45,46 @@ ] set dimensional_bar [ad_dimensional $dimensional] -# ad_table definition -set table_def [list \ - [list num "[_ general-comments.Num]" {} {$Tcount}] \ - [list comment_id "[_ general-comments.ID]" {} \ - {$comment_id}] \ - [list title "[_ general-comments.Title_1]" {} {}] \ - [list approved_p "[_ general-comments.Approved]" {} 01] \ - [list live_version_p "[_ general-comments.Has_live_version]" {} 01] \ - [list pretty_date "[_ general-comments.Last_Modified]" {creation_date $order} {[lc_time_fmt $creation_date "%x %X"]}] \ -] +template::list::create -name comments_list \ + -multirow comments \ + -no_data "#general-comments.lt_No_comments_available#" \ + -html {align center} \ + -elements { + counter { + label "#general-comments.Num#" + } + comment_id { + label "#general-comments.ID#" + display_template {@comments.comment_id@} + orderby {comment_id} + } + title { + label "#general-comments.Title_1#" + orderby {title} + } + approved_p { + label "#general-comments.Approved#" + html {align center} + orderby {approved_p} + } + live_version_p { + label "#general-comments.Has_live_version#" + html {align center} + orderby {approved_p} + } + pretty_date { + label "#general-comments.Last_Modified#" + orderby {creation_date} + } + } -filters {approval {} modified {}} -# create the table to display the comments -set bind_ns_set [ad_tcl_vars_to_ns_set user_id] -set extra_var_list [list return_url $return_url] -set comments_table [ad_table -Torderby $orderby \ - -Tmissing_text "[_ general-comments.lt_No_comments_available]" \ - -Textra_vars $extra_var_list \ - -bind $bind_ns_set \ - comments_select {} $table_def] +set count 0 +db_multirow -extend {user_id return_url counter pretty_date} comments comments_select {} { + set counter [incr count] + set pretty_date [lc_time_fmt $creation_date "%x %X"] + set approved_p [util_PrettyTclBoolean $approved_p] + set live_version_p [util_PrettyTclBoolean $live_version_p] +} set page_title "[_ general-comments.General_Comments]" set context {} Index: openacs-4/packages/general-comments/www/admin/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/admin/Attic/index-oracle.xql,v diff -u -r1.1 -r1.1.26.1 --- openacs-4/packages/general-comments/www/admin/index-oracle.xql 14 Jun 2001 19:52:22 -0000 1.1 +++ openacs-4/packages/general-comments/www/admin/index-oracle.xql 8 Aug 2014 12:29:13 -0000 1.1.26.1 @@ -21,7 +21,7 @@ r.revision_id = o.object_id and r.revision_id = content_item.get_latest_revision(g.comment_id) [ad_dimensional_sql $dimensional] - [ad_order_by_from_sort_spec $orderby $table_def] + [template::list::orderby_clause -orderby -name comments_list] Index: openacs-4/packages/general-comments/www/admin/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/admin/Attic/index-postgresql.xql,v diff -u -r1.2 -r1.2.20.1 --- openacs-4/packages/general-comments/www/admin/index-postgresql.xql 15 Nov 2002 11:16:56 -0000 1.2 +++ openacs-4/packages/general-comments/www/admin/index-postgresql.xql 8 Aug 2014 12:29:13 -0000 1.2.20.1 @@ -22,8 +22,7 @@ r.revision_id = o.object_id and r.revision_id = i.latest_revision [ad_dimensional_sql $dimensional]) as unordered - [ad_order_by_from_sort_spec $orderby $table_def] - + [template::list::orderby_clause -orderby -name comments_list] Index: openacs-4/packages/general-comments/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/admin/index.adp,v diff -u -r1.4.20.1 -r1.4.20.2 --- openacs-4/packages/general-comments/www/admin/index.adp 11 Sep 2013 18:40:27 -0000 1.4.20.1 +++ openacs-4/packages/general-comments/www/admin/index.adp 8 Aug 2014 12:29:13 -0000 1.4.20.2 @@ -5,8 +5,10 @@

@dimensional_bar;noquote@

-@comments_table;noquote@ + + + Index: openacs-4/packages/general-comments/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/admin/index.tcl,v diff -u -r1.4 -r1.4.20.1 --- openacs-4/packages/general-comments/www/admin/index.tcl 7 Nov 2002 08:32:50 -0000 1.4 +++ openacs-4/packages/general-comments/www/admin/index.tcl 8 Aug 2014 12:29:13 -0000 1.4.20.1 @@ -7,8 +7,10 @@ @author Pascal Scheffers (pascal@scheffers.net) @creation-date 2000-10-12 @cvs-id $Id$ -} { - {orderby {} } +} -query { + {orderby:optional} + {approval "any"} + {modified "any"} } -properties { page_title:onevalue context:onevalue @@ -36,54 +38,55 @@ ] set dimensional_bar [ad_dimensional $dimensional] -# ad_table definition -set table_def [list \ - [list num "[_ general-comments.Num]" {} {$Tcount}] \ - [list comment_id "[_ general-comments.ID]" {} \ - {$comment_id}] \ - [list title "[_ general-comments.Title_1]" {} {}] \ - [list author "[_ general-comments.Author]" {upper(author) $order} \ - {$author}] \ - [list approved_p "[_ general-comments.Approved]" {} 01] \ - [list live_version_p "[_ general-comments.Has_live_version]" {} 01] \ - [list pretty_date "[_ general-comments.Last_Modified]" {creation_date $order} {}] \ - [list actions "[_ general-comments.Actions]" {} \ - { - [if {$approved_p} { - subst {[_ general-comments.reject]} - } else { - subst {[_ general-comments.approve]} - }] | [_ general-comments.delete]}]\ -] - -# sql to retrieve comments -set sql " - select g.comment_id, - r.title, - acs_object.name(o.creation_user) as author, - o.creation_user, - decode(i.live_revision,null,0,1) as live_version_p, - decode(i.live_revision,r.revision_id,1,0) as approved_p, - to_char(o.creation_date, 'MM-DD-YYYY HH12:MI:AM') as pretty_date - from general_comments g, - cr_items i, - cr_revisions r, - acs_objects o - where g.comment_id = i.item_id and - r.revision_id = o.object_id and - r.revision_id = content_item.get_latest_revision(g.comment_id) - [ad_dimensional_sql $dimensional] - [ad_order_by_from_sort_spec $orderby $table_def] -" +template::list::create -name comments_list \ + -multirow comments \ + -no_data "#general-comments.lt_No_comments_available#" \ + -html {align center} \ + -elements { + counter { + label "#general-comments.Num#" + } + comment_id { + label "#general-comments.ID#" + display_template {@comments.comment_id@} + orderby {comment_id} + } + title { + label "#general-comments.Title_1#" + orderby {title} + } + approved_p_pretty { + label "#general-comments.Approved#" + html {align center} + orderby {approved_p} + } + live_version_p { + label "#general-comments.Has_live_version#" + html {align center} + orderby {approved_p} + } + pretty_date { + label "#general-comments.Last_Modified#" + orderby {creation_date} + } + actions { + label "#general-comments.Actions#" + display_template { + + #general-comments.reject##general-comments.approve# | + [_ general-comments.delete] + } + } + } -filters {approval {} modified {}} -# create the table to display the comments -set extra_var_list [list return_url $return_url] +set count 0 +db_multirow -extend {user_id return_url counter approved_p_pretty pretty_date} comments comments_select {} { + set counter [incr count] + set pretty_date [lc_time_fmt $creation_date "%x %X"] + set approved_p_pretty [util_PrettyTclBoolean $approved_p] + set live_version_p [util_PrettyTclBoolean $live_version_p] +} -set comments_table [ad_table -Torderby $orderby \ - -Tmissing_text "[_ general-comments.lt_No_comments_available]" \ - -Textra_vars $extra_var_list \ - comments_select $sql $table_def] - set page_title "[_ general-comments.lt_General_Comments_Admi]" set context {}