view 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
line wrap: on
line source

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers">
  <!--  annotator for digilib -->
  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/showdown.js"></script>
  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/annotator-dl.js"></script>
  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.vector.js"></script>
  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.annotator.js"></script>
  <link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/annotator.min.css"/>

  <script type="text/javascript" 
    tal:define="global annServerUrl python:here.sslifyUrl('//tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager', app=here);
    global annTokenUrl string:$viewerUrl/template/token/getLoginToken;
    annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['imagePath'],pageinfo['pn']);
    resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']);
    global annUser python:here.getAuthenticatedUser(anon='anonymous');
    global annGroup python:request.get('annotator_group', None);
    permUser python:test(annGroup, 'group:%s'%annGroup, annUser);"
    tal:content="structure string:
    dlOpts.digilibFrontendPath='/jquery/digilib-mpiwg.html';
    dlOpts.annotationServerUrl='$annServerUrl/annotator';
    dlOpts.annotationTokenUrl='$annTokenUrl';
    dlOpts.annotationUser='$annUser';
    dlOpts.annotatorPlugins=['Auth','GroupPermissions','Markdown','DigilibIntegrator','Store'];
    dlOpts.annotationPageUri='$annUrl';
    dlOpts.annotatorPluginSettings={'Store':{'annotationData':{'uri':'$annUrl','resource':'$resUrl'},'loadFromSearch':{'uri':'$annUrl'}},
        'Permissions':{'read':[],'update':['$permUser'],'delete':['$permUser'],'admin':['$permUser']}};
    "></script>
</metal:block>

</head>
<body>
  <!-- right-side options -->
  <div class="col buttons">
    <!-- LAYER DISPLAY OPTION  -->
    <ul>
      <li metal:define-macro="layer_select_li">
        <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator"
          tal:attributes="checked python:'annotator' in viewLayers" /> Annotator
      </li>
    </ul>
  </div>

  <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers">
    <!-- BEGIN ANNOTATIONS -->
    <div class="options">
      <h4>Annotator</h4>
      <ul>
        <li><a href="javascript:$digilib.digilib('setAnnotationMark')"> <img tal:condition="exists:here/template/annotation-mark.png"
            tal:attributes="src here/template/annotation-mark.png/absolute_url" /> annotate point
        </a></li>
        <li><a href="javascript:$digilib.digilib('setAnnotationRect')"> <img tal:condition="exists:here/template/annotation-region.png"
            tal:attributes="src here/template/annotation-region.png/absolute_url" /> annotate rectangle
        </a></li>
        <li><a href="javascript:$digilib.digilib('setAnnotationPolygon')"> <img tal:condition="exists:here/template/annotation-polygon.png"
            tal:attributes="src here/template/annotation-polygon.png/absolute_url" /> annotate polygon
        </a></li>
        <li><a href="javascript:$digilib.digilib('setAnnotationPolyline')"> <img tal:condition="exists:here/template/annotation-polyline.png"
            tal:attributes="src here/template/annotation-polyline.png/absolute_url" /> annotate polyline
        </a></li>
      </ul>
      <p>
        User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>.
      </p>
      <!-- TODO: login button -->
      <form class="autosubmit" tal:attributes="action viewerUrl">
        <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params"
          tal:attributes="name param; value python:params[param]" />
        <p>
          In group
          <select class="autosubmit" name="annotator_group">
            <option value="" tal:attributes="selected not:annGroup;"> </option>
            <option
              tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl=annServerUrl)"
              tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" />
          </select> <br /> 
          <input type="submit" value="Go!" />
        </p>
      </form>
      <p tal:define="std modules/Products.PythonScripts.standard">
        <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">Log in</a>
      </p>
    </div>
    <!-- END ANNOTATIONS -->
  </metal:block>

</body>

</html>