From: dbs Date: Thu, 26 Aug 2010 01:38:54 +0000 (+0000) Subject: Add font-weight to label settings to support boldness X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c3903e92f642e7d480a7b969e55969bb7d30c132;p=evergreen%2Fbjwebb.git Add font-weight to label settings to support boldness * font-weight gets its own user-editable setting on the label generator UI, along with a library setting, so now you too can have bold spine labels applied uniformly at your library (but overridden for individual labels) * Convert a few hardcoded labels to entities in passing git-svn-id: svn://svn.open-ils.org/ILS/trunk@17342 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index cf7c4cba3..8d57dbdb8 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -68,7 +68,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0380'); -- dbs +INSERT INTO config.upgrade_log (version) VALUES ('0381'); -- dbs CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 8ee21df8e..a75177ec3 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -6706,6 +6706,14 @@ INSERT INTO config.org_unit_setting_type (name, label, description, datatype) 'coust', 'description'), 'integer' ) + ,('cat.label.font.weight', + oils_i18n_gettext('cat.label.font.weight', + 'Cataloging: Spine and pocket label font weight', 'coust', 'label'), + oils_i18n_gettext('cat.label.font.weight', + 'Set the preferred font weight for spine and pocket labels. You can specify "normal", "bold", "bolder", or "lighter".', + 'coust', 'description'), + 'string' + ) ; INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES @@ -6714,6 +6722,7 @@ INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES ,(1, 'cat.spine.line.width', 8) ,(1, 'cat.label.font.family', '"monospace"') ,(1, 'cat.label.font.size', 10) + ,(1, 'cat.label.font.weight', '"normal"') ; diff --git a/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql b/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql new file mode 100644 index 000000000..6530ea13e --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql @@ -0,0 +1,19 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0381'); -- dbs + +INSERT INTO config.org_unit_setting_type (name, label, description, datatype) + VALUES + ('cat.label.font.weight', + oils_i18n_gettext('cat.label.font.weight', + 'Cataloging: Spine and pocket label font weight', 'coust', 'label'), + oils_i18n_gettext('cat.label.font.weight', + 'Set the preferred font weight for spine and pocket labels. You can specify "normal", "bold", "bolder", or "lighter".', + 'coust', 'description'), + 'string' + ) +; + +INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES + (1, 'cat.label.font.weight', '"normal"') +; diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 53c93828c..383180e50 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2654,16 +2654,19 @@ + + + diff --git a/Open-ILS/xul/staff_client/server/cat/spine_labels.js b/Open-ILS/xul/staff_client/server/cat/spine_labels.js index 1be57e864..da3631222 100644 --- a/Open-ILS/xul/staff_client/server/cat/spine_labels.js +++ b/Open-ILS/xul/staff_client/server/cat/spine_labels.js @@ -100,6 +100,11 @@ label_cfg.font_size = g.data.hash.aous['cat.label.font.size'] || 10; $('pt').value = label_cfg.font_size; } + label_cfg.font_weight = $('font_weight').value; /* font weight */ + if (!label_cfg.font_weight) { + label_cfg.font_weight = g.data.hash.aous['cat.label.font.weight'] || 'normal'; + $('font_weight').value = label_cfg.font_weight; + } label_cfg.font_family = g.data.hash.aous['cat.label.font.family'] || 'monospace'; label_cfg.pocket_width = Number($('plw').value) || 28; /* pocket label width */ label_cfg.pocket_length = Number($('pll').value) || 9; /* pocket label length */ @@ -155,7 +160,11 @@ var tb = document.createElement('textbox'); hb2.appendChild(tb); tb.value = ''; tb.setAttribute('class','plain'); - tb.setAttribute('style','font-family: ' + label_cfg.font_family + '; font-size: ' + label_cfg.font_size); + tb.setAttribute('style', + 'font-family: ' + label_cfg.font_family + + '; font-size: ' + label_cfg.font_size + + '; font-weight: ' + label_cfg.font_weight + ); tb.setAttribute('size',label_cfg.spine_width+1); tb.setAttribute('maxlength',label_cfg.spine_width); tb.setAttribute('name','spine'); @@ -200,7 +209,12 @@ if ($('pl').checked && j < label_cfg.pocket_length) { var tb2 = document.createElement('textbox'); hb2.appendChild(tb2); tb2.value = ''; - tb2.setAttribute('class','plain'); tb2.setAttribute('style','font-family: ' + label_cfg.font_family + '; font-size: ' + label_cfg.font_size); + tb2.setAttribute('class','plain'); + tb2.setAttribute('style', + 'font-family: ' + label_cfg.font_family + + '; font-size: ' + label_cfg.font_size + + '; font-weight: ' + label_cfg.font_weight + ); tb2.setAttribute('size',label_cfg.pocket_width+1); tb2.setAttribute('maxlength',label_cfg.pocket_width); tb2.setAttribute('name','pocket'); if ($('title').checked && $('title_line').value == j + 1 && instanceOf(volume.record(),mvr)) { @@ -418,6 +432,10 @@ $('pt').value = pt; } var ff = g.data.hash.aous['cat.spine.font.family'] || 'monospace'; + var fw = $('font_weight').value; /* font weight */ + if (!fw) { + fw = g.data.hash.aous['cat.label.font.weight'] || 'normal'; + } var lm = Number($('lm').value); /* left margin */ if (!lm) { lm = g.data.hash.aous['cat.spine.line.margin'] || 11; @@ -436,7 +454,7 @@ var plw = Number($('plw').value) || 28; var pll = Number($('pll').value) || 9; /* pocket label width and length */ var html = ""; html += "" - html += ""; + html += ""; html += "Spine Labels\n"; var nl = document.getElementsByAttribute('name','template'); for (var i = 0; i < nl.length; i++) { diff --git a/Open-ILS/xul/staff_client/server/cat/spine_labels.xul b/Open-ILS/xul/staff_client/server/cat/spine_labels.xul index d6bbc7ab2..d875df442 100644 --- a/Open-ILS/xul/staff_client/server/cat/spine_labels.xul +++ b/Open-ILS/xul/staff_client/server/cat/spine_labels.xul @@ -47,16 +47,22 @@ accesskey="&staff.cat.spine_labels.close_window.accesskey;" oncommand="window.close()"/> - - + + + + + + - + @@ -76,7 +82,7 @@ - +