Index: openacs-4/contrib/packages/cop-ui/lib/contributions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-ui/lib/contributions.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/packages/cop-ui/lib/contributions.tcl 14 May 2004 11:30:15 -0000 1.4 +++ openacs-4/contrib/packages/cop-ui/lib/contributions.tcl 15 Jun 2004 11:48:48 -0000 1.5 @@ -137,7 +137,6 @@ } } -set icons [cop::rating::icon_base] set now [clock_to_ansi [clock seconds]] set restrict {} @@ -154,13 +153,13 @@ append restrict "\nand o.package_id in ([join $packages ,])" } -# TODO: need to get the dimension to display, need to find the right CoP +# JCDXXX: TODO: need to get the dimension to display, need to find the right CoP, permissions db_multirow -extend {stars url_one ratings_url user_url new} content content " - SELECT o.title, o.object_id, o.title, t.pretty_name as object_type, r.rating_ave, r.ratings, v.views, to_char(o.last_modified,'YYYY-MM-DD HH24:MI:SS') as last_modified, u.user_id, u.first_names || ' ' || u.last_name as name + SELECT o.title, o.object_id, o.title, t.pretty_name as object_type, r.all_rating_ave as rating_ave, r.all_ratings as ratings, v.views, to_char(o.last_modified,'YYYY-MM-DD HH24:MI:SS') as last_modified, u.user_id, u.first_names || ' ' || u.last_name as name FROM acs_object_types t, acs_objects o left outer join cr_items i on (o.object_id = i.item_id) - left outer join cop_rating_aggregates r on (o.object_id = r.object_one) - left outer join cop_object_view_agg v on (v.object_id = o.object_id) + left outer join rating_aggregates r on (o.object_id = r.object_id) + left outer join view_aggregates v on (v.object_id = o.object_id) left outer join acs_users_all u on (u.user_id = o.creation_user) WHERE t.object_type = case when o.object_type = 'content_item' then i.content_type else o.object_type end and o.object_type in ('content_item','pinds_blog_entry','forums_forum','forums_message', @@ -169,22 +168,22 @@ $restrict [template::list::orderby_clause -orderby -name "content"]$limit" { if {![empty_string_p $rating_ave]} { - set ratings_url "/cop1/cop/ratings/ratings?object_id=$object_id" + set ratings_url [export_vars -base ratings object_id] set rating [format %.1f [expr {(round(2.0*$rating_ave))/2.0}]] - set stars "\"$rating\"" + set stars [ratings::icon::html_fragment -rating $rating_ave] set ratings "$ratings" } else { set stars {none} - set ratings "0" + set ratings 0 } - # XXXJCD - make this work in general. + # JCDXXX - make this work in general. if {($object_id % 3) == 0} { set new {NEW} } else { set new {} } - # XXXJCD - make this work in general. + # JCDXXX - make this work in general. regsub {/www/cop1/static} $title {} title set last_modified [regsub -all { } [util::age_pretty -hours_limit 0 -mode_2_fmt "%X %a" -mode_3_fmt "%x" -timestamp_ansi $last_modified -sysdate_ansi $now] {\ }]