LP#1269911: composite attributes: configurable "icons" attribute
authorBill Erickson <berick@esilibrary.com>
Wed, 5 Feb 2014 21:18:38 +0000 (16:18 -0500)
committerDan Wells <dbw2@calvin.edu>
Fri, 21 Feb 2014 20:38:52 +0000 (15:38 -0500)
Honor the configurable icon attribute within the TPAC.

Create a default set of icons, by copying from the existing icons,
which roughly map to the new "icon_format" record attribute
definition mappings.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
23 files changed:
Open-ILS/src/templates/opac/parts/misc_util.tt2
Open-ILS/web/images/format_icons/icon_format/book.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/braille.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/casaudiobook.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/casmusic.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/cdaudiobook.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/cdmusic.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/dvd.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/eaudio.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/ebook.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/equip.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/evideo.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/kit.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/lpbook.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/map.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/microform.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/phonomusic.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/phonospoken.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/picture.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/score.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/serial.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/software.png [new file with mode: 0644]
Open-ILS/web/images/format_icons/icon_format/vhs.png [new file with mode: 0644]

index 41ac634..78898fb 100644 (file)
         END;
 
         # "mattype" == "custom marc format specifier"
-        FOR icon_style IN ['mattype', 'item_type']; 
-            node = xml.findnodes(
-                '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]');
-            IF node AND node.textContent;
-                type = node.textContent;
-                args.format_label = PROCESS get_ccvm_label id=node.getAttribute('cvmid') search_label=1;
-                IF !args.format_label;
-                    args.format_label = node.getAttribute('coded-value');
-                END;
-                args.schema.itemtype = schema_typemap.$type || 'CreativeWork';
-                args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ type _ '.png';
-                LAST;
+        icon_style = ctx.get_cgf('opac.icon_attr').value || 'item_type';
+        node = xml.findnodes(
+            '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]');
+        IF node AND node.textContent;
+            type = node.textContent;
+            args.format_label = PROCESS get_ccvm_label id=node.getAttribute('cvmid') search_label=1;
+            IF !args.format_label;
+                args.format_label = node.getAttribute('coded-value');
             END;
+            args.schema.itemtype = schema_typemap.$type || 'CreativeWork';
+            args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ type _ '.png';
+            LAST;
         END;
        
         args.bibid = [];
diff --git a/Open-ILS/web/images/format_icons/icon_format/book.png b/Open-ILS/web/images/format_icons/icon_format/book.png
new file mode 100644 (file)
index 0000000..2800684
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/book.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/braille.png b/Open-ILS/web/images/format_icons/icon_format/braille.png
new file mode 100644 (file)
index 0000000..2800684
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/braille.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/casaudiobook.png b/Open-ILS/web/images/format_icons/icon_format/casaudiobook.png
new file mode 100644 (file)
index 0000000..5ada234
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/casaudiobook.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/casmusic.png b/Open-ILS/web/images/format_icons/icon_format/casmusic.png
new file mode 100644 (file)
index 0000000..132ca40
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/casmusic.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/cdaudiobook.png b/Open-ILS/web/images/format_icons/icon_format/cdaudiobook.png
new file mode 100644 (file)
index 0000000..5ada234
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/cdaudiobook.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/cdmusic.png b/Open-ILS/web/images/format_icons/icon_format/cdmusic.png
new file mode 100644 (file)
index 0000000..132ca40
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/cdmusic.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/dvd.png b/Open-ILS/web/images/format_icons/icon_format/dvd.png
new file mode 100644 (file)
index 0000000..dd0a56f
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/dvd.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/eaudio.png b/Open-ILS/web/images/format_icons/icon_format/eaudio.png
new file mode 100644 (file)
index 0000000..b6ddf3e
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/eaudio.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/ebook.png b/Open-ILS/web/images/format_icons/icon_format/ebook.png
new file mode 100644 (file)
index 0000000..2800684
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/ebook.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/equip.png b/Open-ILS/web/images/format_icons/icon_format/equip.png
new file mode 100644 (file)
index 0000000..7b76d03
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/equip.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/evideo.png b/Open-ILS/web/images/format_icons/icon_format/evideo.png
new file mode 100644 (file)
index 0000000..dd0a56f
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/evideo.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/kit.png b/Open-ILS/web/images/format_icons/icon_format/kit.png
new file mode 100644 (file)
index 0000000..7b76d03
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/kit.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/lpbook.png b/Open-ILS/web/images/format_icons/icon_format/lpbook.png
new file mode 100644 (file)
index 0000000..2800684
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/lpbook.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/map.png b/Open-ILS/web/images/format_icons/icon_format/map.png
new file mode 100644 (file)
index 0000000..f9f8047
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/map.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/microform.png b/Open-ILS/web/images/format_icons/icon_format/microform.png
new file mode 100644 (file)
index 0000000..2800684
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/microform.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/phonomusic.png b/Open-ILS/web/images/format_icons/icon_format/phonomusic.png
new file mode 100644 (file)
index 0000000..132ca40
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/phonomusic.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/phonospoken.png b/Open-ILS/web/images/format_icons/icon_format/phonospoken.png
new file mode 100644 (file)
index 0000000..5ada234
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/phonospoken.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/picture.png b/Open-ILS/web/images/format_icons/icon_format/picture.png
new file mode 100644 (file)
index 0000000..e523300
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/picture.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/score.png b/Open-ILS/web/images/format_icons/icon_format/score.png
new file mode 100644 (file)
index 0000000..f7b5c7b
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/score.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/serial.png b/Open-ILS/web/images/format_icons/icon_format/serial.png
new file mode 100644 (file)
index 0000000..2800684
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/serial.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/software.png b/Open-ILS/web/images/format_icons/icon_format/software.png
new file mode 100644 (file)
index 0000000..a347513
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/software.png differ
diff --git a/Open-ILS/web/images/format_icons/icon_format/vhs.png b/Open-ILS/web/images/format_icons/icon_format/vhs.png
new file mode 100644 (file)
index 0000000..dd0a56f
Binary files /dev/null and b/Open-ILS/web/images/format_icons/icon_format/vhs.png differ