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> |
---|
5 | <metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers"> |
---|
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> |
---|
26 | <!-- <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/annotateitpermissions.js"></script> --> |
---|
27 | <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/auth.js"></script> |
---|
28 | <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/tags.js"></script> |
---|
29 | <script |
---|
30 | tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/unsupported.js"></script> |
---|
31 | <!-- <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/filter.js"></script> --> |
---|
32 | |
---|
33 | <script type="text/javascript" |
---|
34 | tal:define="annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']); |
---|
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> |
---|
39 | |
---|
40 | <script type="text/javascript"> |
---|
41 | // <!-- |
---|
42 | $(document).ready(function() { |
---|
43 | // annotator |
---|
44 | var elem = $('div.pageContent').get(0); |
---|
45 | var uri = annotatorPageUrl; |
---|
46 | var devAnnotator = new Annotator(elem).addPlugin('Auth', { |
---|
47 | tokenUrl : 'template/token?user='+annotatorUser |
---|
48 | }).addPlugin('Permissions', { |
---|
49 | permissions: { |
---|
50 | 'read': [], |
---|
51 | 'update': [permissionUser], |
---|
52 | 'delete': [permissionUser], |
---|
53 | 'admin': [permissionUser] |
---|
54 | }, |
---|
55 | user : permissionUser, |
---|
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', { |
---|
69 | //prefix: 'http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager/annotator', |
---|
70 | prefix: 'http://r583-1.mpiwg-berlin.mpg.de:18080/AnnotationManager/annotator', |
---|
71 | annotationData : { |
---|
72 | 'uri' : uri |
---|
73 | }, |
---|
74 | loadFromSearch : { |
---|
75 | 'limit' : 20, |
---|
76 | 'uri' : uri |
---|
77 | } |
---|
78 | }).addPlugin('Tags' |
---|
79 | ); |
---|
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" |
---|
93 | tal:attributes="checked python:'annotator' in viewLayers" /> Annotations |
---|
94 | </li> |
---|
95 | </ul> |
---|
96 | </div> |
---|
97 | |
---|
98 | <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers"> |
---|
99 | <!-- BEGIN ANNOTATIONS --> |
---|
100 | <div class="options"> |
---|
101 | <h4>Annotations</h4> |
---|
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> |
---|
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> |
---|
122 | <!-- <a class="button" tal:attributes="href python:'%s/login/logout?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">log out</a> --> |
---|
123 | </p> |
---|
124 | </div> |
---|
125 | <!-- END ANNOTATIONS --> |
---|
126 | </metal:block> |
---|
127 | |
---|
128 | </body> |
---|
129 | |
---|
130 | </html> |
---|