diff options
Diffstat (limited to 'python/fatcat_web')
-rw-r--r-- | python/fatcat_web/routes.py | 12 | ||||
-rw-r--r-- | python/fatcat_web/templates/base.html | 2 | ||||
-rw-r--r-- | python/fatcat_web/templates/editor_annotations.html | 35 | ||||
-rw-r--r-- | python/fatcat_web/templates/editor_view.html | 1 |
4 files changed, 47 insertions, 3 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index bce3c529..7b406ff5 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -357,8 +357,6 @@ def editgroup_create_annotation(ident): abort(ae.status) return redirect('/editgroup/{}'.format(ident)) -# XXX: editor's annotations - @app.route('/editgroup/<ident>/accept', methods=['POST']) @login_required def editgroup_accept(ident): @@ -433,6 +431,16 @@ def editor_editgroups(ident): return render_template('editor_editgroups.html', editor=editor, editgroups=editgroups) +@app.route('/editor/<ident>/annotations', methods=['GET']) +def editor_annotations(ident): + try: + editor = api.get_editor(ident) + annotations = api.get_editor_annotations(ident, limit=50) + except ApiException as ae: + abort(ae.status) + return render_template('editor_annotations.html', editor=editor, + annotations=annotations) + @app.route('/changelog', methods=['GET']) def changelog_view(): try: diff --git a/python/fatcat_web/templates/base.html b/python/fatcat_web/templates/base.html index fa5f8f7f..dda905e0 100644 --- a/python/fatcat_web/templates/base.html +++ b/python/fatcat_web/templates/base.html @@ -59,8 +59,8 @@ <div class="ui simple dropdown item"> {{ current_user.username }} <i class="dropdown icon"></i> <div class="menu"> - {# <a class="item" href="#"><i class="edit icon"></i>Edits in Progress</a> #} <a class="item" href="/editor/{{ current_user.editor_id }}/editgroups"><i class="history icon"></i>Edit History</a> + <a class="item" href="/editor/{{ current_user.editor_id }}/annotations"><i class="edit icon"></i>Comment History</a> <div class="divider"></div> <a class="item" href="/auth/account"><i class="settings icon"></i>Account</a> <a class="item" href="/auth/logout"><i class="sign out icon"></i>Logout</a> diff --git a/python/fatcat_web/templates/editor_annotations.html b/python/fatcat_web/templates/editor_annotations.html new file mode 100644 index 00000000..c46039f5 --- /dev/null +++ b/python/fatcat_web/templates/editor_annotations.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} +{% block body %} + +<h1 class="ui header">Comments and Annotations +<div class="sub header"> + <code>editor + <a href="/editor/{{editor.editor_id}}">{{ editor.username }}</a> + </code> + </a> +</div> +</h1> + +<br> +{% for annotation in annotations %} + <div class="ui segments"> + <div class="ui top attached secondary segment"> + On <b><small><code><a href="/editgroup/{{ annotation.editgroup_id }}"> + {{ annotation.editgroup_id }} + </a></code></small></b> + at {{ annotation.created.strftime("%Y-%m-%d %H:%M:%S") }} + </div> + {% if annotation.extra %} + <div class="ui attached segment"> + {{ entity_macros.extra_metadata(annotation.extra) }} + </div> + {% endif %} + <div class="ui bottom attached segment"> + {{ annotation.comment_markdown|markdown(escape=True) }} + </div> + </div> +{% else %} + <i>None!</i> +{% endfor %} + +{% endblock %} diff --git a/python/fatcat_web/templates/editor_view.html b/python/fatcat_web/templates/editor_view.html index 000922c0..c62f8d93 100644 --- a/python/fatcat_web/templates/editor_view.html +++ b/python/fatcat_web/templates/editor_view.html @@ -8,5 +8,6 @@ </h1> <p><b><a href="/editor/{{ editor.editor_id }}/editgroups">Edit History</a></b> +<p><b><a href="/editor/{{ editor.editor_id }}/annotations">Comments and Annotation History</a></b> {% endblock %} |