Index: openacs-4/packages/xowiki/tcl/table-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/Attic/table-widget-procs.tcl,v diff -u -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/xowiki/tcl/table-widget-procs.tcl 6 Oct 2021 12:21:01 -0000 1.1.2.14 +++ openacs-4/packages/xowiki/tcl/table-widget-procs.tcl 25 Dec 2021 16:10:22 -0000 1.1.2.15 @@ -44,14 +44,6 @@ append cols [subst {BulkAction create objects -id ID -actions {$actions}}] \n append cols {HiddenField create ID} \n } - if {"publish_status" in $buttons} { - append cols {ImageAnchorField create _publish_status \ - -orderby _publish_status.src -src "" \ - -width 8 -height 8 -title "Toggle Publish Status" \ - -alt "publish status" -label [_ xowiki.publish_status] \ - -CSSclass publish-status-item-button \ - } \n - } if {"edit" in $buttons} { append cols {AnchorField create _edit -CSSclass edit-item-button -label "" \ -no_csv 1 -richtext 1} \n @@ -68,11 +60,9 @@ append cols {AnchorField create _revisions -CSSclass revisions-item-button -label "" \ -no_csv 1 -richtext 1} \n } - if {"slim_publish_status" in $buttons} { - append cols {ImageAnchorField create _publish_status \ - -orderby _publish_status.src -src "" \ - -width 8 -height 8 -title "Toggle Publish Status" \ - -alt "publish status" -label "" \ + if {"slim_publish_status" in $buttons || "publish_status" in $buttons} { + append cols {AnchorField create _publish_status \ + -richtext 1 -label "" \ -CSSclass publish-status-item-button \ } \n } @@ -93,8 +83,14 @@ ] \n } } + if {"archive" in $buttons} { + append cols [list AnchorField create _archive \ + -CSSclass archive-item-button \ + -label "" \ + -no_csv 1 \ + -richtext 1] \n + } if {"delete" in $buttons} { - #append cols [list ImageField_DeleteIcon _delete -label "" -no_csv 1] \n append cols [list AnchorField create _delete \ -CSSclass delete-item-button \ -label "" \ @@ -199,19 +195,23 @@ $__c set ID [$p item_id] } if {"publish_status" in $buttons || "slim_publish_status" in $buttons} { - $__c set _publish_status " " - $__c set _publish_status.title #xowiki.publish_status# - if {[$p set publish_status] eq "ready"} { - set image active.png + $__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 image inactive.png + set CSSclass red set state "ready" } - set url [export_vars -base [::$package_id package_url]admin/set-publish-state \ - {state {revision_id "[$p set revision_id]"} return_url}] - $__c set _publish_status.src /resources/xowiki/$image - $__c set _publish_status.href $url + $__c set _publish_status.CSSclass $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 + }] } if {"edit" in $buttons} { $__c set _edit " " @@ -228,6 +228,14 @@ $__c set _delete.title #xowiki.delete# $__c set _delete.href [::$package_id make_link -link $page_link $p delete return_url] } + if {"archive" in $buttons} { + #$__c set _archive ""; #content: "\e025"; + $__c set _archive " " + $__c set _archive.title #xowiki.Archive_title# + set url [export_vars -base [::$package_id package_url]admin/set-publish-state \ + {{state expired} {revision_id "[$p set revision_id]"} return_url}] + $__c set _archive.href $url + } if {"revisions" in $buttons} { $__c set _revisions "" $__c set _revisions.title #xowiki.revisions# @@ -254,6 +262,10 @@ $__c set _last_modified [$p set last_modified] $__c set _raw_last_modified [$p set last_modified] + # just necessary, when object_type is requested + #set icon [$__c render_icon] + #ns_log notice "... render icon? [$__c procsearch render_icon] // [$__c info precedence]" + #ns_log notice "field_names <$field_names> [llength $field_names] [llength $form_field_objs]" foreach __fn $field_names form_field_obj $form_field_objs { #ns_log notice "... field_name <$__fn> obj $form_field_obj <[$form_field_obj name]>"