Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Templates/annotate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,4 @@ <h4>Select Schema and Mode</h4>
</div>
<div id="overlapContextMenu"></div>
<div id="propertyContextMenu"></div>
<div id="errorMessage"><div><div>Error</div><pre></pre></div><div><div>Global Info</div><ul></ul></div><div><div>Local Info</div><ul></ul></div><div>Please contact your administrator with above information</div></div>
{% endblock %}
16 changes: 8 additions & 8 deletions src/Templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
<!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">

{% load staticfiles %}
{% load static %}
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>{% block title %}{{ title }}{% endblock %}</title>

<link rel="SHORTCUT ICON" type="image/x-icon" href="{{ root_url }}{% static "image/anaforafavicon.png" %}" />
<link rel="icon" type="image/x-icon" href="{{ root_url }}{% static "image/anaforafavicon.png" %}" />
<link rel="SHORTCUT ICON" type="image/x-icon" href="{{ root_url }}{{ STATIC_URL }}anaforafavicon.png"/>
<link rel="icon" type="image/x-icon" href="{{ root_url }}{{ STATIC_URL }}anaforafavicon.png" />
{% for cssName in css %}
<link rel="stylesheet" href="{{ root_url }}{% static cssName %}" type="text/css" media="screen" />
<link rel="stylesheet" href="{{ root_url }}{{ STATIC_URL }}{{ cssName }}" type="text/css" media="screen" />
{% endfor %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
{% for jsName in js %}
<script src="{{ root_url }}{% static jsName %}" type="text/javascript"></script>
<script src="{{ root_url }}{{ STATIC_URL }}{{jsName}}" type="text/javascript"></script>
{% endfor %}
{% for schema, schemaMode in js_schemaSpecific.items %} {% ifequal schema settingVars.schema %} {% if settingVars.isAdjudication %} {% if schemaMode.adjudication %} {% for jsName in schemaMode.adjudication %}
<script src="{{ root_url }}{% static jsName %}" type="text/javascript"></script>
<script src="{{ root_url }}{{ STATIC_URL }}{{jsName}}" type="text/javascript"></script>
{% endfor %} {% endif %} {% else %} {% if schemaMode.annotate %} {% for jsName in schemaMode.annotate %}
<script src="{{ root_url }}{% static jsName %}" type="text/javascript"></script>
<script src="{{ root_url }}{{ STATIC_URL }}{{jsName}}" type="text/javascript"></script>
{% endfor %} {% endif %} {% endif %} {% endifequal %} {% endfor %}
<script type="text/JavaScript">
var _setting = {
Expand Down
11 changes: 8 additions & 3 deletions src/main/annotate/projectSetting.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@ def parseFromFile(self, filePath):
pass
else:
if mode.needPreannotation:
if mode.preannotationFromMode not in [tMode.name for tMode in schema.modes]:
raise Exception('Preannotation mode name "' + str(mode.preannotationFromMode) + '" from mode "' + mode.name + '" of schema "' + schemaName + '" is not exists')
if mode.preannotationFromMode.strip() == "":
mode.preannotationFromMode = None
else:
mode.preannotationFromMode = schema.getMode(mode.preannotationFromMode)

mode.preannotationFromMode = [tMode for tMode in schema.modes if tMode.name == mode.preannotationFromMode][0]
#if mode.preannotationFromMode not in [tMode.name for tMode in schema.modes]:
# raise Exception('Preannotation mode name "' + str(mode.preannotationFromMode) + '" from mode "' + mode.name + '" of schema "' + schemaName + '" is not exists')

#mode.preannotationFromMode = [tMode for tMode in schema.modes if tMode.name == mode.preannotationFromMode][0]

def isSchemaExist(self, schemaName, modeName = "default"):
if schemaName not in self.schemaList:
Expand Down
9 changes: 6 additions & 3 deletions src/main/annotate/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

css = ["css/style.css", "css/themes/default/style.css"]

js_lib = ["js/lib/" + js_file for js_file in ["jquery.jstree.js", "jquery.jstree.schema.js", "jquery.hotkeys.js", "jquery.ui.position.js", "jquery.contextMenu.js", "jquery.json-2.4.min.js", "jquery.cookie.js"]]
js_lib = ["js/lib/" + js_file for js_file in ["jquery.jstree.js", "jquery.jstree.schema.js", "jquery.hotkeys.js", "jquery.ui.position.min.js", "jquery.contextMenu.min.js", "jquery.json-2.4.min.js", "jquery.cookie.js"]]

js_annotate = ["js/annotate/" + js_file for js_file in ["errorHandler.js", "schema.js", "anaforaProject.js", "anaforaObj.js", "annotate.js", "propertyFrame.js", "annotateFrame.js", "aObjSelectionMenu.js", "projectSelector.js", "anaforaAdjudicationProject.js", "relationFrame.js"]]
js_annotate = ["js/annotate/" + js_file for js_file in ["schema.js", "anaforaProject.js", "anaforaObj.js", "annotate.js", "propertyFrame.js", "annotateFrame.js", "aObjSelectionMenu.js", "projectSelector.js", "anaforaAdjudicationProject.js", "relationFrame.js"]]

js_schemaSpecific = {"Coreference": {"adjudication":["js/annotate/anaforaAdjudicationProjectCoreference.js"]}}

Expand Down Expand Up @@ -311,14 +311,17 @@ def setCompleted(request, projectName, corpusName, taskName, schemaName):
if os.path.exists(fileName + ".inprogress.xml"):
subprocess.call(["mv", fileName + ".inprogress.xml", fileName + ".completed.xml"])
subprocess.call("sed -u -i 's/<progress>in-progress<\/progress>/<progress>completed<\/progress>/' " + fileName + ".completed.xml", shell=True)
#subprocess.call("sed -u -i 's/@%s/@gold/' %s.completed.xml" % (request.META["REMOTE_USER"], fileName), shell=True)
mode = ps.getMode(*(schemaName.replace("-Adjudication", "").split("-")))
if "-Adjudication" in schemaName or mode.directSetGold:
# set as gold
if mode.directSetGold:
subprocess.call("sed -u -i 's/@%s/@gold/' %s.completed.xml" % (request.META["REMOTE_USER"], fileName), shell=True)
fileNameGold = filePath + "/" + taskName + "." + schemaName.replace("-Adjudication", "") + ".gold.completed.xml"
subprocess.call(["cp", fileName + ".completed.xml", fileNameGold])
schema = ps.getSchema(schemaName.split("-")[0])
for tMode in schema.modes:
if tMode.needPreannotation and tMode.preannotationFromMode == mode:
if tMode.needPreannotation and tMode.preannotationFromMode is not None and tMode.preannotationFromMode.name == mode.name:
fileNamePreannotation = filePath + "/" + taskName + "." + schema.name + "-" + tMode.name + ".preannotation.completed.xml"
subprocess.call(["cp", fileNameGold, fileNamePreannotation])

Expand Down
40 changes: 6 additions & 34 deletions src/main/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -989,14 +989,18 @@ progress[aria-valuenow]:before {
padding: 10px;
}

#schemaSelector div ul {
padding-left: 10px;
}

#projectSelectorWindow h5 {
display: none;
border-bottom: 1px solid #9a9a9a;
margin: 0px;
}

#projectSelectorWindow ul {
max-height: 220px;
#projectSelector ul {
max-height: 300px;
max-width: 260px;

overflow-y: auto;
Expand Down Expand Up @@ -1082,35 +1086,3 @@ progress[aria-valuenow]:before {
opacity: 0.6;
z-index: 999;
}

#errorMessage {
display:none;
background: white;
padding: 20px;
border: 2px solid #ddd;
float: left;
font-size: 1.2em;
position: fixed;
top: 50%; left: 50%;
z-index: 99999;
box-shadow: 0px 0px 20px #999; /* CSS3 */
-moz-box-shadow: 0px 0px 20px #999; /* Firefox */
-webkit-box-shadow: 0px 0px 20px #999; /* Safari, Chrome */
border-radius:3px 3px 3px 3px;
-moz-border-radius: 3px; /* Firefox */
-webkit-border-radius: 3px; /* Safari, Chrome */
}

#errorMessage > div {
padding-bottom: 10px;
border-top: 1px solid #B9B9B9;
}

#errorMessage > div > div {
font-weight: bold;
}

#errorMessage > div > ul, #errorMessage > div > pre {
max-height: 150px;
overflow-y: scroll;
}
Loading