source: gs3-installations/atea/trunk/interfaces/atea/transform/pages/ocr.xsl@ 36878

Last change on this file since 36878 was 36878, checked in by cstephen, 3 months ago

Fix OCR for production deployment

File size: 3.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- See ocr/README.md -->
3
4<xsl:stylesheet version="1.0"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 xmlns:java="http://xml.apache.org/xslt/java"
7 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
8 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
9 xmlns:gslib="http://www.greenstone.org/skinning"
10 extension-element-prefixes="java util"
11 exclude-result-prefixes="java util">
12
13 <!-- use the 'main' layout -->
14 <xsl:import href="layouts/main.xsl"/>
15
16 <xsl:variable name="groupPath"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/></xsl:variable>
17 <!-- set page title -->
18 <xsl:template name="pageTitle">
19 <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText('atea', /page/@lang, 'atea.ocr.Title')"/>
20 </xsl:template>
21
22 <!-- set page breadcrumbs -->
23 <xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/>
24 <xsl:if test="$groupPath != ''">
25 <xsl:for-each select="/page/pageResponse/pathList/group">
26 <xsl:sort data-type="number" select="@position" />
27 <a>
28 <xsl:attribute name="href"><gslib:groupHref path="{@path}"/></xsl:attribute>
29 <xsl:attribute name="title"><gslib:groupName path="{@path}"/></xsl:attribute>
30 <gslib:groupName path="{@path}" />
31 </a>
32 <gslib:rightArrow/>
33 </xsl:for-each>
34 </xsl:if>
35 </xsl:template>
36
37 <!-- the page content -->
38 <xsl:template match="/page">
39 <xsl:call-template name="atea-ocr" />
40 </xsl:template>
41
42 <xsl:template name="atea-ocr">
43 <link rel="icon" href="interfaces/{$interface_name}/ocr/dist/favicon.png" />
44 <link href="interfaces/{$interface_name}/ocr/dist/assets/index.css" rel="preload" as="style" />
45 <link href="interfaces/{$interface_name}/ocr/dist/index.js" rel="preload" as="script" />
46 <link href="interfaces/{$interface_name}/ocr/dist/assets/index.css" rel="stylesheet" />
47
48 <gsf:style>
49 .ui-widget-content a {
50 color: inherit;
51 }
52
53 body {
54 display: flex;
55 flex-direction: column;
56 align-items: stretch;
57 }
58
59 #container {
60 background-color: var(--page-bg-color);
61 line-height: initial;
62 flex-grow: 1;
63 max-width: none;
64 margin: 0;
65 }
66
67 #gs_content {
68 padding: 0;
69 background-color: var(--page-bg-color);
70 height: 100%;
71 }
72
73 #gs_banner {
74 display: none;
75 }
76
77 #topArea {
78 margin: 0;
79 max-width: none;
80 background-color: rgb(var(--primary-bg-color));
81 }
82
83 .app-bar {
84 box-shadow: 0 3px 4px -3px #404040;
85 border-radius: 0 0 5px 5px;
86 }
87
88 .ui-button {
89 background-color: rgb(var(--primary-bg-color-l1));
90 color: var(--fg-color);
91 border-color: white;
92 }
93 </gsf:style>
94
95 <noscript>
96 <strong>We're sorry, but the Māori OCR Service doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
97 </noscript>
98
99 <div id="app"></div>
100 <!-- built files will be auto injected -->
101
102 <gslib:langfrag name="atea.ocr" />
103 <gsf:script type="module" src="interfaces/{$interface_name}/ocr/dist/index.js"></gsf:script>
104 </xsl:template>
105
106</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.