[open-ils-commits] r17342 - in trunk/Open-ILS: src/sql/Pg src/sql/Pg/upgrade web/opac/locale/en-US xul/staff_client/server/cat (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Aug 25 21:38:56 EDT 2010


Author: dbs
Date: 2010-08-25 21:38:54 -0400 (Wed, 25 Aug 2010)
New Revision: 17342

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql
Modified:
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
   trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
   trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
   trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js
   trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.xul
Log:
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


Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-08-26 00:16:11 UTC (rev 17341)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-08-26 01:38:54 UTC (rev 17342)
@@ -68,7 +68,7 @@
     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,

Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-08-26 00:16:11 UTC (rev 17341)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-08-26 01:38:54 UTC (rev 17342)
@@ -6706,6 +6706,14 @@
                 '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 @@
     ,(1, 'cat.spine.line.width', 8)
     ,(1, 'cat.label.font.family', '"monospace"')
     ,(1, 'cat.label.font.size', 10)
+    ,(1, 'cat.label.font.weight', '"normal"')
 ;
 
 

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql	2010-08-26 01:38:54 UTC (rev 17342)
@@ -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"')
+;

Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-08-26 00:16:11 UTC (rev 17341)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-08-26 01:38:54 UTC (rev 17342)
@@ -2654,16 +2654,19 @@
 <!ENTITY staff.cat.spine_labels.close_window.label "Close Window">
 <!ENTITY staff.cat.spine_labels.close_window.accesskey "C">
 <!ENTITY staff.cat.spine_labels.font_size.label "Font size (in points):">
+<!ENTITY staff.cat.spine_labels.font_weight.label 'Font weight ("normal" or "bold"):'>
 <!ENTITY staff.cat.spine_labels.spine_label.label "Spine Label">
 <!ENTITY staff.cat.spine_labels.spine_label.left_margin.label "Left Margin (in characters):">
 <!ENTITY staff.cat.spine_labels.spine_label.label_width.label "Label Width (in characters):">
 <!ENTITY staff.cat.spine_labels.spine_label.label_length.label "Label Length (in lines):">
 <!ENTITY staff.cat.spine_labels.pocket_label.label "Pocket Label">
+<!ENTITY staff.cat.spine_labels.pocket_label.enabled.label "Enabled">
 <!ENTITY staff.cat.spine_labels.pocket_label.middle_margin.label "Middle Margin (in characters):">
 <!ENTITY staff.cat.spine_labels.pocket_label.label_width.label "Label Width (in characters):">
 <!ENTITY staff.cat.spine_labels.pocket_label.label_length.label "Label Length (in lines):">
 <!ENTITY staff.cat.spine_labels.pocket_label.title.label "Include Title (wraps on word at label width)">
 <!ENTITY staff.cat.spine_labels.on_line.label "On line:">
+<!ENTITY staff.cat.spine_labels.pocket_label.include_author.label "Include Author">
 <!ENTITY staff.cat.spine_labels.pocket_label.include_title.label "Include Title (segment after wrapping)">
 <!ENTITY staff.cat.spine_labels.indent_title.label "Indent a space?">
 <!ENTITY staff.cat.spine_labels.inc_call_number.label "Include Call Number">

Modified: trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js	2010-08-26 00:16:11 UTC (rev 17341)
+++ trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js	2010-08-26 01:38:54 UTC (rev 17342)
@@ -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><head>";
                     html += "<link type='text/css' rel='stylesheet' href='" + xulG.url_prefix('/xul/server/skin/print.css') + "'></link>"
-                    html += "<link type='text/css' rel='stylesheet' href='data:text/css,pre{font-family:" + ff + ";font-size:" + pt + "pt;}'></link>";
+                    html += "<link type='text/css' rel='stylesheet' href='data:text/css,pre{font-family:" + ff + ";font-size:" + pt + "pt; font-weight: " + fw + ";}'></link>";
                     html += "<title>Spine Labels</title></head><body>\n";
                     var nl = document.getElementsByAttribute('name','template');
                     for (var i = 0; i < nl.length; i++) {

Modified: trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.xul	2010-08-26 00:16:11 UTC (rev 17341)
+++ trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.xul	2010-08-26 01:38:54 UTC (rev 17342)
@@ -47,16 +47,22 @@
                     accesskey="&staff.cat.spine_labels.close_window.accesskey;" oncommand="window.close()"/>
             </hbox>
 
-            <hbox>
-                <label value="&staff.cat.spine_labels.font_size.label;" control="pt"/>
-                <textbox id="pt" value="" onchange="this.setAttribute('value',this.value)" oils_persist="value" context="clipboard"/>
-            </hbox>
+            <grid><columns><column/><column/></columns><rows>
+                <row>
+                    <label value="&staff.cat.spine_labels.font_size.label;" control="pt"/>
+                    <textbox id="pt" value="" onchange="this.setAttribute('value',this.value)" oils_persist="value" context="clipboard"/>
+                </row>
+                <row>
+                    <label value="&staff.cat.spine_labels.font_weight.label;" control="font_weight"/>
+                    <textbox id="font_weight" value="" onchange="this.setAttribute('value',this.value)" oils_persist="value" context="clipboard"/>
+                </row>
+            </rows></grid>
             <grid><columns><column/><column/><column/><column/></columns><rows>
                 <row> <label class="header" value="&staff.cat.spine_labels.spine_label.label;"/><spacer/> </row>
                 <row> <label value="&staff.cat.spine_labels.spine_label.left_margin.label;" control="lm"/><textbox id="lm" value="" onchange="this.setAttribute('value',this.value)" oils_persist="value" context="clipboard"/> </row>
                 <row> <label value="&staff.cat.spine_labels.spine_label.label_width.label;" control="lw"/><textbox id="lw" value="" onchange="this.setAttribute('value',this.value)" oils_persist="value" context="clipboard"/> </row>
                 <row> <label value="&staff.cat.spine_labels.spine_label.label_length.label;" control="ll"/><textbox id="ll" value="" onchange="this.setAttribute('value',this.value)" oils_persist="value" context="clipboard"/> </row>
-                <row> <label class="header" value="&staff.cat.spine_labels.pocket_label.label;"/><checkbox id="pl" checked="false" oils_persist="checked" label="Enabled"/> </row>
+                <row> <label class="header" value="&staff.cat.spine_labels.pocket_label.label;"/><checkbox id="pl" checked="false" oils_persist="checked" label="&staff.cat.spine_labels.pocket_label.enabled.label;"/> </row>
                 <row> <label value="&staff.cat.spine_labels.pocket_label.middle_margin.label;" control="mm"/><textbox id="mm" value="2" onchange="this.setAttribute('value',this.value)" oils_persist="value" context="clipboard"/> </row>
                 <row> <label value="&staff.cat.spine_labels.pocket_label.label_width.label;" control="plw"/><textbox id="plw" value="28" onchange="this.setAttribute('value',this.value)" oils_persist="value" context="clipboard"/> </row>
                 <row> <label value="&staff.cat.spine_labels.pocket_label.label_length.label;" control="pll"/><textbox id="pll" value="9" onchange="this.setAttribute('value',this.value)" oils_persist="value" context="clipboard"/> </row>
@@ -76,7 +82,7 @@
                 </row>
                 <row> <spacer/><checkbox id="title_r_indent" checked="true" oils_persist="checked" label="&staff.cat.spine_labels.indent_title.label;"/> </row>
                 <row>
-                    <checkbox id="author" checked="true" oils_persist="checked" label="Include Author"/>
+                    <checkbox id="author" checked="true" oils_persist="checked" label="&staff.cat.spine_labels.pocket_label.include_author.label;"/>
                     <hbox>
                         <label value="&staff.cat.spine_labels.on_line.label;"/>
                         <textbox id="author_line" value="3" oils_persist="value" onchange="this.setAttribute('value',this.value)" context="clipboard"/>



More information about the open-ils-commits mailing list