diff --git a/app.py b/app.py index 7571dfc..bfac721 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,6 @@ import argparse import sys -from flask import Flask +from flask import Flask, render_template from flask.ext.restful import reqparse, Api, Resource from decoder import Decoder from languages import new_lang_from_long_english_name @@ -11,6 +11,10 @@ app = Flask(__name__) api = Api(app) +@app.route('/') +def home(): + return render_template('index.html') + http_parser = reqparse.RequestParser() http_parser.add_argument('inputText', type=unicode, location='json') http_parser.add_argument('inputLanguage', type=str, location='json') diff --git a/html/README.md b/html/README.md deleted file mode 100644 index 42eb037..0000000 --- a/html/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Load index.html to directly query instances of Joshua servers running with `-server-mode http`. -This should be updated to use the translation engine instead, allowing for the specification of -which backend engine (language pair) to use. - -It would also be good to update the server to allow it to be AJAX-queried about which backends -it has running. diff --git a/html/favicon.ico b/static/img/favicon.ico similarity index 100% rename from html/favicon.ico rename to static/img/favicon.ico diff --git a/html/joshua-logo.ico b/static/img/joshua-logo.ico similarity index 100% rename from html/joshua-logo.ico rename to static/img/joshua-logo.ico diff --git a/html/bootstrap/css/bootstrap-theme.css b/static/js/bootstrap/css/bootstrap-theme.css similarity index 100% rename from html/bootstrap/css/bootstrap-theme.css rename to static/js/bootstrap/css/bootstrap-theme.css diff --git a/html/bootstrap/css/bootstrap-theme.css.map b/static/js/bootstrap/css/bootstrap-theme.css.map similarity index 100% rename from html/bootstrap/css/bootstrap-theme.css.map rename to static/js/bootstrap/css/bootstrap-theme.css.map diff --git a/html/bootstrap/css/bootstrap-theme.min.css b/static/js/bootstrap/css/bootstrap-theme.min.css similarity index 100% rename from html/bootstrap/css/bootstrap-theme.min.css rename to static/js/bootstrap/css/bootstrap-theme.min.css diff --git a/html/bootstrap/css/bootstrap-theme.min.css.map b/static/js/bootstrap/css/bootstrap-theme.min.css.map similarity index 100% rename from html/bootstrap/css/bootstrap-theme.min.css.map rename to static/js/bootstrap/css/bootstrap-theme.min.css.map diff --git a/html/bootstrap/css/bootstrap.css b/static/js/bootstrap/css/bootstrap.css similarity index 100% rename from html/bootstrap/css/bootstrap.css rename to static/js/bootstrap/css/bootstrap.css diff --git a/html/bootstrap/css/bootstrap.css.map b/static/js/bootstrap/css/bootstrap.css.map similarity index 100% rename from html/bootstrap/css/bootstrap.css.map rename to static/js/bootstrap/css/bootstrap.css.map diff --git a/html/bootstrap/css/bootstrap.min.css b/static/js/bootstrap/css/bootstrap.min.css similarity index 100% rename from html/bootstrap/css/bootstrap.min.css rename to static/js/bootstrap/css/bootstrap.min.css diff --git a/html/bootstrap/css/bootstrap.min.css.map b/static/js/bootstrap/css/bootstrap.min.css.map similarity index 100% rename from html/bootstrap/css/bootstrap.min.css.map rename to static/js/bootstrap/css/bootstrap.min.css.map diff --git a/html/bootstrap/fonts/glyphicons-halflings-regular.eot b/static/js/bootstrap/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from html/bootstrap/fonts/glyphicons-halflings-regular.eot rename to static/js/bootstrap/fonts/glyphicons-halflings-regular.eot diff --git a/html/bootstrap/fonts/glyphicons-halflings-regular.svg b/static/js/bootstrap/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from html/bootstrap/fonts/glyphicons-halflings-regular.svg rename to static/js/bootstrap/fonts/glyphicons-halflings-regular.svg diff --git a/html/bootstrap/fonts/glyphicons-halflings-regular.ttf b/static/js/bootstrap/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from html/bootstrap/fonts/glyphicons-halflings-regular.ttf rename to static/js/bootstrap/fonts/glyphicons-halflings-regular.ttf diff --git a/html/bootstrap/fonts/glyphicons-halflings-regular.woff b/static/js/bootstrap/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from html/bootstrap/fonts/glyphicons-halflings-regular.woff rename to static/js/bootstrap/fonts/glyphicons-halflings-regular.woff diff --git a/html/bootstrap/fonts/glyphicons-halflings-regular.woff2 b/static/js/bootstrap/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from html/bootstrap/fonts/glyphicons-halflings-regular.woff2 rename to static/js/bootstrap/fonts/glyphicons-halflings-regular.woff2 diff --git a/html/bootstrap/js/bootstrap.js b/static/js/bootstrap/js/bootstrap.js similarity index 100% rename from html/bootstrap/js/bootstrap.js rename to static/js/bootstrap/js/bootstrap.js diff --git a/html/bootstrap/js/bootstrap.min.js b/static/js/bootstrap/js/bootstrap.min.js similarity index 100% rename from html/bootstrap/js/bootstrap.min.js rename to static/js/bootstrap/js/bootstrap.min.js diff --git a/html/bootstrap/js/npm.js b/static/js/bootstrap/js/npm.js similarity index 100% rename from html/bootstrap/js/npm.js rename to static/js/bootstrap/js/npm.js diff --git a/html/demo.js b/static/js/demo.js similarity index 100% rename from html/demo.js rename to static/js/demo.js diff --git a/html/jquery-2.2.0.min.js b/static/js/jquery-2.2.0.min.js similarity index 100% rename from html/jquery-2.2.0.min.js rename to static/js/jquery-2.2.0.min.js diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..63036d5 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,110 @@ +{% extends "layout.html" %} +{% block content %} + + + + + +
+
+
+

Input

+
+
+
+ +
+ + + +
+
+ +
+ +
+
+
+
+ Host + + Port + +
+
+ +
Feature weights
+
+
+ LM weight + +
+ +
+
+
+
+
+ +
+
+

Custom rules

+
+
+
+
+
+
+ + +
+ +
+
+
+
+
+ +
+
+

Output

+
+
+
+
+ +
+ + +
+ +{% endblock %} \ No newline at end of file diff --git a/html/index.html b/templates/layout.html similarity index 77% rename from html/index.html rename to templates/layout.html index ec642e5..b984e44 100644 --- a/html/index.html +++ b/templates/layout.html @@ -12,7 +12,7 @@ Joshua Machine Translation Toolkit - +