Index: openacs-4/packages/acs-templating/acs-templating.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/acs-templating.info,v diff -u -r1.72 -r1.73 --- openacs-4/packages/acs-templating/acs-templating.info 27 Oct 2024 18:19:32 -0000 1.72 +++ openacs-4/packages/acs-templating/acs-templating.info 28 Oct 2024 17:09:41 -0000 1.73 @@ -9,7 +9,7 @@ f t - + OpenACS Templating library. 2024-09-02 @@ -27,7 +27,7 @@ GPL version 2 3 - + Index: openacs-4/packages/acs-templating/tcl/style-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/style-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/tcl/style-procs.tcl 25 Oct 2024 09:50:28 -0000 1.4 +++ openacs-4/packages/acs-templating/tcl/style-procs.tcl 28 Oct 2024 17:09:41 -0000 1.5 @@ -272,17 +272,35 @@ } } + :public object method registerCSSclasses {toolkit dict} { + # + # Register CSS class mapping for the provided framework + # + nsv_set acs_templating_cssClasses $toolkit $dict + } + :public object method class {-toolkit name} { # # In case, a mapping for CSS classes is defined, return the # mapping for the provided class name. Otherwise return the - # provided class name. + # input class name unmodified. # if {![info exists toolkit]} { set toolkit ${:preferredCSSToolkit} + if {$toolkit eq "default"} { + set toolkit [template::toolkit] + set :preferredCSSToolkit $toolkit + ns_log notice "derived CSS toolkit '$toolkit'" + } } - #ns_log notice "CSS CLASS <$name> get from toolkit $toolkit exists [dict exists ${:cssClasses} $toolkit $name]" + if {[nsv_get acs_templating_cssClasses $toolkit dict]} { + if {[dict exists $dict $name]} { + return [dict get $dict $name] + } + } else { + ns_log warning "template::CSS: no class mapping for toolkit $toolkit provided (should be in theme definition)" + } if {[dict exists ${:cssClasses} $toolkit $name]} { return [dict get ${:cssClasses} $toolkit $name] } else { Index: openacs-4/packages/openacs-bootstrap3-theme/openacs-bootstrap3-theme.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/openacs-bootstrap3-theme/openacs-bootstrap3-theme.info,v diff -u -r1.7 -r1.8 --- openacs-4/packages/openacs-bootstrap3-theme/openacs-bootstrap3-theme.info 3 Sep 2024 15:37:39 -0000 1.7 +++ openacs-4/packages/openacs-bootstrap3-theme/openacs-bootstrap3-theme.info 28 Oct 2024 17:09:41 -0000 1.8 @@ -9,7 +9,7 @@ f f - + manderga Theme for OpenACS based on Twitter Bootstrap 3 2024-09-02 @@ -22,11 +22,11 @@ GPL version 2 2 - + - + Index: openacs-4/packages/openacs-bootstrap3-theme/tcl/resource-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/openacs-bootstrap3-theme/tcl/resource-init.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/openacs-bootstrap3-theme/tcl/resource-init.tcl 3 Sep 2024 15:37:39 -0000 1.4 +++ openacs-4/packages/openacs-bootstrap3-theme/tcl/resource-init.tcl 28 Oct 2024 17:09:41 -0000 1.5 @@ -7,6 +7,19 @@ -urn urn:ad:js:jquery \ -resource /resources/openacs-bootstrap3-theme/js/jquery-3.7.1.min.js +::template::CSS registerCSSclasses bootstrap { + action "btn btn-default" + btn-default btn-default + bulk-action "btn btn-default" + card "panel panel-default" + card-body panel-body + card-header panel-heading + d-none hidden + form-action "btn btn-default" + margin-form "" + text-warning text-warn +} + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/openacs-bootstrap5-theme/openacs-bootstrap5-theme.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/openacs-bootstrap5-theme/openacs-bootstrap5-theme.info,v diff -u -r1.2 -r1.3 --- openacs-4/packages/openacs-bootstrap5-theme/openacs-bootstrap5-theme.info 11 Sep 2024 05:55:46 -0000 1.2 +++ openacs-4/packages/openacs-bootstrap5-theme/openacs-bootstrap5-theme.info 28 Oct 2024 17:09:41 -0000 1.3 @@ -9,7 +9,7 @@ f f - + manderga Gustaf Neumann Theme for OpenACS based on Twitter Bootstrap 5 @@ -23,12 +23,12 @@ GPL version 2 2 - + - + Index: openacs-4/packages/openacs-bootstrap5-theme/tcl/resource-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/openacs-bootstrap5-theme/tcl/resource-init.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/openacs-bootstrap5-theme/tcl/resource-init.tcl 11 Sep 2024 05:55:47 -0000 1.2 +++ openacs-4/packages/openacs-bootstrap5-theme/tcl/resource-init.tcl 28 Oct 2024 17:09:41 -0000 1.3 @@ -11,6 +11,20 @@ -urn urn:ad:js:jquery \ -resource /resources/openacs-bootstrap5-theme/js/jquery-3.7.1.min.js +::template::CSS registerCSSclasses bootstrap5 { + action "btn btn-outline-secondary btn-sm m-1" + btn-default btn-outline-secondary + bulk-action "btn btn-outline-secondary btn-sm" + checkbox-inline form-check-inline + close btn-close + cog gear + form-action "btn btn-outline-secondary btn-sm m-1" + margin-form "" + navbar-default navbar-light + navbar-right ms-auto + print printer + radio-inline form-check-inline +} # Local variables: # mode: tcl # tcl-indent-level: 4