PINES Cust: Don't auto-open added content in staff client
authorTerran McCanna <tmccanna@georgialibraries.org>
Sat, 5 Jan 2019 00:22:30 +0000 (19:22 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 6 Nov 2019 17:29:27 +0000 (12:29 -0500)
Novelist and Syndetics content will still automatically open in
the OPAC but not in the staff client, which should improve client
performance.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates/opac/parts/record/extras.tt2

index 5f35ddd..8443b0a 100644 (file)
             IF extra.hide; NEXT; END; 
             name = extra.name;
         %]
+<!-- PINES: Extensive Customizations to force added content to be expanded automatically in OPAC but not in client  -->
         <div class="rdetail_extras">
             <div class="rdetail_extras_hr"></div>
             <div class="rdetail_extras_link">
                 [%
-                    IF tab_is_active(name) OR name == 'awards' OR name == 'addedcontent';
-                        href = mkurl('', {}, ['expand', 'ac']);
-                        arrow = arrow_down;
-                                       ELSE;
-                        href = mkurl('', {expand => name}) _ '#' _ name;
-                        arrow = arrow_right;
+                    IF ctx.is_staff;
+                        IF tab_is_active(name);
+                            href = mkurl('', {}, ['expand', 'ac']);
+                            arrow = arrow_down;
+                        ELSE;
+                            href = mkurl('', {expand => name}) _ '#' _ name;
+                            arrow = arrow_right;
+                        END;
+                    ELSE;
+                        IF tab_is_active(name) OR name == 'awards' OR name == 'addedcontent';
+                            href = mkurl('', {}, ['expand', 'ac']);
+                            arrow = arrow_down;
+                        ELSE;
+                            href = mkurl('', {expand => name}) _ '#' _ name;
+                            arrow = arrow_right;
+                        END;
                     END;
                 %]
                 <a name='[% name %]' href='[% href %]' class="rdetail_extras_lbl" rel="nofollow" vocab="">[% arrow %] [% extra.label | html %]</a>
             </div>
         </div>
         <div class='rdetail_extras_div'>
-            [%  IF tab_is_active(name) OR name == 'awards' OR name == 'addedcontent';
-                    IF name == 'marchtml';
-                        ctx.marchtml;
-                    ELSE;
-                        # Load the template for the selected extra
-                        INCLUDE "opac/parts/record/${name}.tt2";
+            [%
+                IF ctx.is_staff;               
+                    IF tab_is_active(name);
+                        IF name == 'marchtml';
+                            ctx.marchtml;
+                        ELSE;
+                            # Load the template for the selected extra
+                            INCLUDE "opac/parts/record/${name}.tt2";
+                        END;
+                    END;
+                ELSE;
+                    IF tab_is_active(name) OR name == 'awards' OR name == 'addedcontent';
+                        IF name == 'marchtml';
+                            ctx.marchtml;
+                        ELSE;
+                            # Load the template for the selected extra
+                            INCLUDE "opac/parts/record/${name}.tt2";
+                        END;
                     END;
-                END; 
+                END;
             %]
         </div>
         [% END %]