Mercurial > hg > documentViewer
annotate zpt/layer_text_annotator.zpt @ 552:13eb36c0b00c
layer template for pundit layer
author | casties |
---|---|
date | Wed, 19 Sep 2012 10:37:38 +0200 |
parents | a35ec08c782d |
children | 841c2094af63 |
rev | line source |
---|---|
525 | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
3 <html xmlns="http://www.w3.org/1999/xhtml"> | |
4 <head> | |
526 | 5 <metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers"> |
525 | 6 <!-- annotator --> |
7 <link rel="stylesheet" type="text/css" | |
8 tal:attributes="href string:$rootUrl/template/annotator_files/css/annotator.css" /> | |
9 | |
10 <script | |
11 tal:attributes="src string:$rootUrl/template/annotator_files/lib/vendor/json2.js"></script> | |
12 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/extensions.js"></script> | |
13 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/console.js"></script> | |
14 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/class.js"></script> | |
15 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/range.js"></script> | |
16 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/annotator.js"></script> | |
17 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/widget.js"></script> | |
18 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/editor.js"></script> | |
19 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/viewer.js"></script> | |
20 <script | |
21 tal:attributes="src string:$rootUrl/template/annotator_files/lib/notification.js"></script> | |
22 <script | |
23 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/store.js"></script> | |
24 <script | |
25 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/permissions.js"></script> | |
547
7c6fdc31bd35
use normalized uri (e.g. http://echo.mpiwg-berlin.mpg.de/documents/permanent/library/163127KK?pn=9)
casties
parents:
546
diff
changeset
|
26 <!-- <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/annotateitpermissions.js"></script> --> |
525 | 27 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/auth.js"></script> |
549 | 28 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/tags.js"></script> |
525 | 29 <script |
30 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/unsupported.js"></script> | |
547
7c6fdc31bd35
use normalized uri (e.g. http://echo.mpiwg-berlin.mpg.de/documents/permanent/library/163127KK?pn=9)
casties
parents:
546
diff
changeset
|
31 <!-- <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/filter.js"></script> --> |
528 | 32 |
33 <script type="text/javascript" | |
547
7c6fdc31bd35
use normalized uri (e.g. http://echo.mpiwg-berlin.mpg.de/documents/permanent/library/163127KK?pn=9)
casties
parents:
546
diff
changeset
|
34 tal:define="annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']); |
546 | 35 global annUser python:here.getAuthenticatedUser(anon='anonymous'); |
36 global annGroup python:request.get('annotator_group', None); | |
37 permUser python:test(annGroup, 'group:%s'%annGroup, annUser);" | |
38 tal:content="structure string:var annotatorPageUrl='$annUrl'; var annotatorUser='$annUser'; var permissionUser='$permUser';"></script> | |
525 | 39 |
40 <script type="text/javascript"> | |
41 // <!-- | |
42 $(document).ready(function() { | |
43 // annotator | |
44 var elem = $('div.pageContent').get(0); | |
528 | 45 var uri = annotatorPageUrl; |
525 | 46 var devAnnotator = new Annotator(elem).addPlugin('Auth', { |
528 | 47 tokenUrl : 'template/token?user='+annotatorUser |
525 | 48 }).addPlugin('Permissions', { |
550 | 49 permissions: { |
50 'read': [], | |
51 'update': [permissionUser], | |
52 'delete': [permissionUser], | |
53 'admin': [permissionUser] | |
54 }, | |
546 | 55 user : permissionUser, |
525 | 56 userString : function(user) { |
57 if (user && user.name) { | |
58 return user.name; | |
59 } | |
60 return user; | |
61 }, | |
62 userId : function(user) { | |
63 if (user && user.id) { | |
64 return user.id; | |
65 } | |
66 return user; | |
67 } | |
68 }).addPlugin('Store', { | |
550 | 69 //prefix: 'http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager/annotator', |
70 prefix: 'http://r583-1.mpiwg-berlin.mpg.de:18080/AnnotationManager/annotator', | |
525 | 71 annotationData : { |
72 'uri' : uri | |
73 }, | |
74 loadFromSearch : { | |
75 'limit' : 20, | |
76 'uri' : uri | |
77 } | |
549 | 78 }).addPlugin('Tags' |
79 ); | |
525 | 80 }); |
81 // --> | |
82 </script> | |
83 | |
84 </metal:block> | |
85 </head> | |
86 <body> | |
87 <!-- right-side options --> | |
88 <div class="col buttons"> | |
89 <!-- LAYER DISPLAY OPTION --> | |
90 <ul> | |
91 <li metal:define-macro="layer_select_li"> | |
92 <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator" | |
552 | 93 tal:attributes="checked python:'annotator' in viewLayers" /> Annotator |
525 | 94 </li> |
95 </ul> | |
96 </div> | |
97 | |
526 | 98 <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers"> |
525 | 99 <!-- BEGIN ANNOTATIONS --> |
546 | 100 <div class="options"> |
552 | 101 <h4>Annotator</h4> |
546 | 102 <p> |
103 User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>. | |
104 </p> | |
105 <!-- TODO: login button --> | |
106 <form class="autosubmit" tal:attributes="action viewerUrl"> | |
107 <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params" | |
108 tal:attributes="name param; value python:params[param]" /> | |
109 <p> | |
110 In group | |
111 <select class="autosubmit" name="annotator_group"> | |
112 <option value="" tal:attributes="selected not:annGroup;"> </option> | |
113 <option | |
114 tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl='http://localhost:18080/AnnotationManager')" | |
115 tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" /> | |
116 </select> <br /> | |
117 <input type="submit" value="Go!" /> | |
118 </p> | |
119 </form> | |
549 | 120 <p tal:define="std modules/Products.PythonScripts.standard"> |
121 <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">log in</a> | |
550 | 122 <!-- <a class="button" tal:attributes="href python:'%s/login/logout?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">log out</a> --> |
549 | 123 </p> |
525 | 124 </div> |
125 <!-- END ANNOTATIONS --> | |
126 </metal:block> | |
127 | |
128 </body> | |
129 | |
130 </html> |