diff --git a/app/main/forms.py b/app/main/forms.py new file mode 100644 index 00000000..d209a6ba --- /dev/null +++ b/app/main/forms.py @@ -0,0 +1,12 @@ +from flask_wtf import FlaskForm +from wtforms import DecimalField, StringField, SubmitField, TextAreaField +from wtforms.validators import DataRequired, Email, Length, NumberRange + + +class FeedbackForm(FlaskForm): + email = StringField('Email', validators=[DataRequired(), Email()]) + feedback = TextAreaField('Feedback', validators=[Length(0, 255)]) + like_range = DecimalField('How would you rate nopaque?', + validators=[DataRequired(), + NumberRange(min=1, max=10)]) + submit = SubmitField('Send feedback') diff --git a/app/main/views.py b/app/main/views.py index 65f02548..8f855399 100644 --- a/app/main/views.py +++ b/app/main/views.py @@ -1,8 +1,10 @@ +from app import logger from app.auth.forms import LoginForm from app.models import User from flask import flash, redirect, render_template, url_for from flask_login import login_required, login_user from . import main +from .forms import FeedbackForm @main.route('/', methods=['GET', 'POST']) @@ -26,6 +28,18 @@ def dashboard(): return render_template('main/dashboard.html.j2', title='Dashboard') +@main.route('/feedback', methods=['GET', 'POST']) +@login_required +def feedback(): + feedback_form = FeedbackForm(prefix='feedback-form') + if feedback_form.validate_on_submit(): + logger.warning(feedback_form.email) + logger.warning(feedback_form.feedback) + logger.warning(feedback_form.like_range) + return render_template('main/feedback.html.j2', + feedback_form=feedback_form, title='Feedback') + + @main.route('/poster', methods=['GET', 'POST']) def poster(): login_form = LoginForm(prefix='login-form') diff --git a/app/templates/auth/login.html.j2 b/app/templates/auth/login.html.j2 index ce6ab69f..6f57d209 100644 --- a/app/templates/auth/login.html.j2 +++ b/app/templates/auth/login.html.j2 @@ -26,8 +26,8 @@
+ {{ login_form.hidden_tag() }}
- {{ login_form.hidden_tag() }}
person {{ login_form.user(class='validate') }} diff --git a/app/templates/auth/register.html.j2 b/app/templates/auth/register.html.j2 index 35ff2436..8b38326a 100644 --- a/app/templates/auth/register.html.j2 +++ b/app/templates/auth/register.html.j2 @@ -24,8 +24,8 @@
+ {{ registration_form.hidden_tag() }}
- {{ registration_form.hidden_tag() }}
person {{ registration_form.username(class='validate', data_length='64') }} @@ -50,7 +50,7 @@ {{ error }} {% endfor %}
-
+
email {{ registration_form.email(class='validate', type='email') }} {{ registration_form.email.label }} diff --git a/app/templates/auth/reset_password.html.j2 b/app/templates/auth/reset_password.html.j2 index 6b947b69..5c6740cf 100644 --- a/app/templates/auth/reset_password.html.j2 +++ b/app/templates/auth/reset_password.html.j2 @@ -9,8 +9,8 @@
+ {{ reset_password_form.hidden_tag() }}
- {{ reset_password_form.hidden_tag() }}
{{ reset_password_form.password(class='validate') }} {{ reset_password_form.password.label }} diff --git a/app/templates/auth/reset_password_request.html.j2 b/app/templates/auth/reset_password_request.html.j2 index 9145e52f..9ea8d8ea 100644 --- a/app/templates/auth/reset_password_request.html.j2 +++ b/app/templates/auth/reset_password_request.html.j2 @@ -8,8 +8,8 @@
+ {{ reset_password_request_form.hidden_tag() }}
- {{ reset_password_request_form.hidden_tag() }}
{{ reset_password_request_form.email(class='validate', type='email') }} {{ reset_password_request_form.email.label }} diff --git a/app/templates/corpora/add_corpus.html.j2 b/app/templates/corpora/add_corpus.html.j2 index a93a7088..39e33abf 100644 --- a/app/templates/corpora/add_corpus.html.j2 +++ b/app/templates/corpora/add_corpus.html.j2 @@ -9,8 +9,8 @@
+ {{ add_corpus_form.hidden_tag() }}
- {{ add_corpus_form.hidden_tag() }}
diff --git a/app/templates/corpora/add_corpus_file.html.j2 b/app/templates/corpora/add_corpus_file.html.j2 index 479b4b62..f792f0fe 100644 --- a/app/templates/corpora/add_corpus_file.html.j2 +++ b/app/templates/corpora/add_corpus_file.html.j2 @@ -9,10 +9,10 @@
-
+ {{ add_corpus_file_form.hidden_tag() }} +
Required metadata - {{ add_corpus_file_form.hidden_tag() }}
diff --git a/app/templates/corpora/edit_corpus_file.html.j2 b/app/templates/corpora/edit_corpus_file.html.j2 index 7a07855a..1c7ef7ef 100644 --- a/app/templates/corpora/edit_corpus_file.html.j2 +++ b/app/templates/corpora/edit_corpus_file.html.j2 @@ -9,9 +9,9 @@
-
+ {{ edit_corpus_file_form.hidden_tag() }} +
- {{ edit_corpus_file_form.hidden_tag() }}
diff --git a/app/templates/main/feedback.html.j2 b/app/templates/main/feedback.html.j2 new file mode 100644 index 00000000..eef11d7e --- /dev/null +++ b/app/templates/main/feedback.html.j2 @@ -0,0 +1,35 @@ +{% extends "nopaque.html.j2" %} + +{% block page_content %} + +
+
+ + {{ feedback_form.hidden_tag() }} +
+

+ {{ feedback_form.like_range.label }} + {{ feedback_form.like_range(class='validate', type='range', min=1, max=10) }} +

+
+ email + {{ feedback_form.email(class='validate', type='email') }} + {{ feedback_form.email.label }} + {% for error in feedback_form.email.errors %} + {{ error }} + {% endfor %} +
+
+ mode_edit + {{ feedback_form.feedback(class='materialize-textarea', data_length=255) }} + {{ feedback_form.feedback.label }} +
+
+
+ {{ macros.submit_button(feedback_form.submit) }} +
+ +
+
+ +{% endblock %} diff --git a/app/templates/main/poster.html.j2 b/app/templates/main/poster.html.j2 index 735715d9..ee5b0a9e 100644 --- a/app/templates/main/poster.html.j2 +++ b/app/templates/main/poster.html.j2 @@ -163,9 +163,9 @@
+ {{ login_form.hidden_tag() }}
Registration and Log in - {{ login_form.hidden_tag() }}
person {{ login_form.user(class='validate') }} diff --git a/app/templates/main/poster2.html.j2 b/app/templates/main/poster2.html.j2 deleted file mode 100644 index 0173042d..00000000 --- a/app/templates/main/poster2.html.j2 +++ /dev/null @@ -1,264 +0,0 @@ -{% extends "nopaque.html.j2" %} - -{% block page_content %} - - -
-
-
- burst_modeFile Setup -

- Häufig liegen Digitalisate textueller Foschungsdaten (Bücher, Briefe etc.) in mehreren Dateien und Formaten vor. Nopaque ermöglicht die Konvertierung und Zusammenfassung in ein einheitliches Datenformat, was eine vereinfachte Weiterverarbeitung mit weiteren Services ermöglicht. -

-
-
-
-
- File - -
-
- -
-
-
-
-

 

- -
-
-
-
-
-
-
-
- -
-
-
- Ausgabe -

Nach Eingabeateinamen sortierte Multipage-TIFF-Dateien.

-
-
-

-

- Umgesetzt mit ImageMagick
- als Docker Swarm Service -
-

-
-
-
-
- -
- -
-
-
- find_in_pageOptical Character Recognition -

- Durch optische Analysemethoden werden aus Bilddaten, wie Fotos oder - Scans, Textdateien erzeugt. Erst dieser Vorverarbeitungsschritt - ermöglicht eine weitere computergestützte Verarbeitung von Dokumenten. -

-
-
-
-
- File - -
-
- -
-
-
-
-

 

- -
-
-
-
-
-
-
-
- -
-
-
- Ausgabe -

- Textdateien, PDF-Dateien und TEI P5 konforme XML-Dateien. -

-
-
-

-

- Pipelineumsetzung mit Tesseract OCR
- als Docker Swarm Service -
-

-
-
-
-
- -
- -
-
-
- format_textdirection_l_to_rNatural Language Processing -

- Mit Hilfe computergestützter linguistischer Datenverarbeitungsmethoden - (Tokenisierung, Lemmatisierung, Part-of-speech-Tagging und - Eigennamenerkennung) werden Textdateien mit weiteren Informationen ausgezeichnet. -

-
-
-
-
- File - -
-
- -
-
-
-
-

 

- -
-
-
-
-
-
-
-
- -
-
-
- Ausgabe -

Korpusdateien im verticalized text-Format (XML-Dialekt, Ähnelt CoNLL).

-
-
-

-

- Pipelineumsetzung mit spaCy
- als Docker Swarm Service -
-

-
-
-
-
- -
- -
-
-
- searchCorpus Analysis -

- Mittels CQP Query Language können komplexe Suchanfragen unter - Zuhilfenahme von Metadaten und NLP-Auszeichnungen an eigens erstellte - Korpora gestellt werden. Ergebnisse können als Text oder in abstrakter Darstellung ausgewertet werden. -

-
- search - -
- subdirectory_arrow_right -

- The | DET - quick | ADJ - brown | ADJ - fox | PROPN - jumps | VERB - over | ADP - the | DET - lazy | ADJ - - dog | NOUN - - . | PUNCT -

-
-
-
-
-
-
- -
-
-
- Ausgabe -

- Export der Ergebnisse in JSON. (Zunkünftig angedacht: CSV, Excel und - HTML) -

-
-
-

-

- Umgesetzt mit IMS Open Corpus Workbench
- als lokaler Docker-Container -
-

-
- -
-

 

-

 

-

 

-

 

-
- - -{% endblock %} diff --git a/app/templates/nopaque.html.j2 b/app/templates/nopaque.html.j2 index 67c8abd6..5a33e27d 100644 --- a/app/templates/nopaque.html.j2 +++ b/app/templates/nopaque.html.j2 @@ -59,7 +59,7 @@ menu {% endif %}