annotate zpt/viewer/layer_image_annotator.zpt @ 630:25295ceb11b1

updated annotation templates to new digilib-annotator version 1.3.5
author casties
date Thu, 04 Jun 2015 16:23:29 +0200
parents 98fe8e168c01
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
585
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
3 <html xmlns="http://www.w3.org/1999/xhtml">
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
4 <head>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
5 <metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers">
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
6 <!-- annotator for digilib -->
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
7 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/showdown.js"></script>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
8 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/annotator-dl.js"></script>
630
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
9 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.vector.js"></script>
585
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
10 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.annotator.js"></script>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
11 <link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/annotator.min.css"/>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
12
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
13 <script type="text/javascript"
627
98fe8e168c01 fix bug with sslify in template.
casties
parents: 626
diff changeset
14 tal:define="global annServerUrl python:here.sslifyUrl('//tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager', app=here);
585
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
15 global annTokenUrl string:$viewerUrl/template/token/getLoginToken;
599
3b79ae4a23ca normalize uri of annotated image.
casties
parents: 598
diff changeset
16 annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['imagePath'],pageinfo['pn']);
585
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
17 resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']);
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
18 global annUser python:here.getAuthenticatedUser(anon='anonymous');
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
19 global annGroup python:request.get('annotator_group', None);
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
20 permUser python:test(annGroup, 'group:%s'%annGroup, annUser);"
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
21 tal:content="structure string:
598
4fe11d2bd4ae use digilib-mpiwg.html for digilib.
casties
parents: 594
diff changeset
22 dlOpts.digilibFrontendPath='/jquery/digilib-mpiwg.html';
586
230ba358da3c fixed annotationServerUrl.
casties
parents: 585
diff changeset
23 dlOpts.annotationServerUrl='$annServerUrl/annotator';
585
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
24 dlOpts.annotationTokenUrl='$annTokenUrl';
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
25 dlOpts.annotationUser='$annUser';
630
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
26 dlOpts.annotatorPlugins=['Auth','GroupPermissions','Markdown','DigilibIntegrator','Store'];
616
3f9b42840901 bug fix, configure annotation pageuri
dwinter
parents: 599
diff changeset
27 dlOpts.annotationPageUri='$annUrl';
585
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
28 dlOpts.annotatorPluginSettings={'Store':{'annotationData':{'uri':'$annUrl','resource':'$resUrl'},'loadFromSearch':{'uri':'$annUrl'}},
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
29 'Permissions':{'read':[],'update':['$permUser'],'delete':['$permUser'],'admin':['$permUser']}};
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
30 "></script>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
31 </metal:block>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
32
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
33 </head>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
34 <body>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
35 <!-- right-side options -->
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
36 <div class="col buttons">
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
37 <!-- LAYER DISPLAY OPTION -->
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
38 <ul>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
39 <li metal:define-macro="layer_select_li">
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
40 <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator"
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
41 tal:attributes="checked python:'annotator' in viewLayers" /> Annotator
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
42 </li>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
43 </ul>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
44 </div>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
45
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
46 <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers">
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
47 <!-- BEGIN ANNOTATIONS -->
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
48 <div class="options">
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
49 <h4>Annotator</h4>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
50 <ul>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
51 <li><a href="javascript:$digilib.digilib('setAnnotationMark')"> <img tal:condition="exists:here/template/annotation-mark.png"
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
52 tal:attributes="src here/template/annotation-mark.png/absolute_url" /> annotate point
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
53 </a></li>
630
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
54 <li><a href="javascript:$digilib.digilib('setAnnotationRect')"> <img tal:condition="exists:here/template/annotation-region.png"
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
55 tal:attributes="src here/template/annotation-region.png/absolute_url" /> annotate rectangle
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
56 </a></li>
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
57 <li><a href="javascript:$digilib.digilib('setAnnotationPolygon')"> <img tal:condition="exists:here/template/annotation-polygon.png"
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
58 tal:attributes="src here/template/annotation-polygon.png/absolute_url" /> annotate polygon
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
59 </a></li>
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
60 <li><a href="javascript:$digilib.digilib('setAnnotationPolyline')"> <img tal:condition="exists:here/template/annotation-polyline.png"
25295ceb11b1 updated annotation templates to new digilib-annotator version 1.3.5
casties
parents: 627
diff changeset
61 tal:attributes="src here/template/annotation-polyline.png/absolute_url" /> annotate polyline
585
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
62 </a></li>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
63 </ul>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
64 <p>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
65 User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>.
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
66 </p>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
67 <!-- TODO: login button -->
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
68 <form class="autosubmit" tal:attributes="action viewerUrl">
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
69 <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params"
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
70 tal:attributes="name param; value python:params[param]" />
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
71 <p>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
72 In group
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
73 <select class="autosubmit" name="annotator_group">
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
74 <option value="" tal:attributes="selected not:annGroup;"> </option>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
75 <option
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
76 tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl=annServerUrl)"
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
77 tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" />
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
78 </select> <br />
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
79 <input type="submit" value="Go!" />
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
80 </p>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
81 </form>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
82 <p tal:define="std modules/Products.PythonScripts.standard">
587
6000c7e24d8a new parameter "pf" to specify image file name. (still some issues)
casties
parents: 586
diff changeset
83 <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">Log in</a>
585
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
84 </p>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
85 </div>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
86 <!-- END ANNOTATIONS -->
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
87 </metal:block>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
88
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
89 </body>
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
90
83eeed69793f new annotator layer for images.
casties
parents:
diff changeset
91 </html>