Index: openacs-4/packages/xowiki/tcl/table-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/table-widget-procs.tcl,v diff -u -r1.1.2.15 -r1.1.2.16 --- openacs-4/packages/xowiki/tcl/table-widget-procs.tcl 25 Dec 2021 16:10:22 -0000 1.1.2.15 +++ openacs-4/packages/xowiki/tcl/table-widget-procs.tcl 5 Jan 2022 19:17:50 -0000 1.1.2.16 @@ -196,18 +196,9 @@ } if {"publish_status" in $buttons || "slim_publish_status" in $buttons} { $__c set _publish_status "■" - set publish_status [$p set publish_status] - if {$publish_status eq "ready"} { - set CSSclass green - set state "production" - } elseif {$publish_status eq "expired"} { - set CSSclass black - set state "production" - } else { - set CSSclass red - set state "ready" - } - $__c set _publish_status.CSSclass $CSSclass + set d [::xowiki::utility publish_status_next_state [$p set publish_status]] + set state [dict get $d state] + $__c set _publish_status.CSSclass [dict get $d CSSclass] $__c set _publish_status.title #xowiki.publish_status_make_$state# $__c set _publish_status.href [export_vars -base [::$package_id package_url]admin/set-publish-state { state {revision_id "[$p set revision_id]"} return_url Index: openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl,v diff -u -r1.57.2.27 -r1.57.2.28 --- openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 31 Dec 2021 11:26:31 -0000 1.57.2.27 +++ openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 5 Jan 2022 19:17:50 -0000 1.57.2.28 @@ -850,6 +850,25 @@ return $renames } + ::xowiki::utility ad_proc publish_status_next_state {publish_status} { + + Determine next publish status and return dict containing + CSSclassand next state. + + } { + if {$publish_status eq "ready"} { + set CSSclass green + set state "production" + } elseif {$publish_status eq "expired"} { + set CSSclass black + set state "production" + } else { + set CSSclass red + set state "ready" + } + return [list CSSclass $CSSclass state $state] + } + ::xowiki::utility ad_proc formCSSclass {form_name} { Obtain CSS class name for a form from its name } { Index: openacs-4/packages/xowiki/www/admin/list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/list.tcl,v diff -u -r1.38.2.10 -r1.38.2.11 --- openacs-4/packages/xowiki/www/admin/list.tcl 5 Jan 2022 18:59:55 -0000 1.38.2.10 +++ openacs-4/packages/xowiki/www/admin/list.tcl 5 Jan 2022 19:17:50 -0000 1.38.2.11 @@ -167,16 +167,9 @@ [export_vars -base permissions {item_id return_url}] } if {$::with_publish_status} { - # TODO: this should get some architectural support - if {$publish_status eq "ready"} { - set CSSclass green - set state "production" - } else { - set CSSclass red - set state "ready" - } - $line set publish_status.CSSclass $CSSclass - $line set publish_status.title #xowiki.publish_status_make_$state# + set d [::xowiki::utility publish_status_next_state $publish_status] + $line set publish_status.CSSclass [dict get $d CSSclass] + $line set publish_status.title #xowiki.publish_status_make_[dict get $d state]# $line set publish_status.href [export_vars -base $page_link {{m toggle-publish-status} return_url}] } $line set page_order $page_order