From 668076105a975c2898c912c6259aa0189a7662a7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 3 Apr 2019 12:10:54 -0700 Subject: reviewable view; improvments to editgroup views --- python/fatcat_web/templates/editor_editgroups.html | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'python/fatcat_web/templates/editor_editgroups.html') diff --git a/python/fatcat_web/templates/editor_editgroups.html b/python/fatcat_web/templates/editor_editgroups.html index cb9b2f56..7643981f 100644 --- a/python/fatcat_web/templates/editor_editgroups.html +++ b/python/fatcat_web/templates/editor_editgroups.html @@ -1,25 +1,31 @@ {% extends "base.html" %} {% block body %} -

Editor Changelog: {{ editor.username }} +

Edit History

-

Changes accepted (aka, merged editgroups): - {# {% for editgroup in editgroups %} - {#
Created (UTC) +
Created (UTC) #} + Status Editgroup - Editor Description
{{ editgroup.created }} +
{{ editgroup.created }} #} + {% if editgroup.changelog_index %} + Merged
(#{{ editgroup.changelog_index }}) + {% elif editgroup.submitted %} + Submitted
({{ editgroup.submitted }}) + {% else %} + Work in Progress + {% endif %}
{{ editgroup.editgroup_id }} - {{ editgroup.editor_id }} {% if editgroup.description != None %}{{ editgroup.description }}{% endif %} {% endfor %}
-- cgit v1.2.3 From eec743ededa463f08f9baea8fd074780b354d8a7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 3 Apr 2019 18:22:06 -0700 Subject: strftime() in a bunch of places --- python/fatcat_web/templates/changelog.html | 2 +- python/fatcat_web/templates/changelog_view.html | 2 +- python/fatcat_web/templates/editgroup_view.html | 2 +- python/fatcat_web/templates/editor_editgroups.html | 4 ++-- python/fatcat_web/templates/release_changelog.html | 17 ----------------- python/fatcat_web/templates/release_view.html | 2 +- python/fatcat_web/templates/stats.html | 2 +- python/fatcat_web/templates/webcapture_view.html | 4 ++-- 8 files changed, 9 insertions(+), 26 deletions(-) delete mode 100644 python/fatcat_web/templates/release_changelog.html (limited to 'python/fatcat_web/templates/editor_editgroups.html') diff --git a/python/fatcat_web/templates/changelog.html b/python/fatcat_web/templates/changelog.html index df51e7db..0d4ae657 100644 --- a/python/fatcat_web/templates/changelog.html +++ b/python/fatcat_web/templates/changelog.html @@ -15,7 +15,7 @@ Limited to the most recent entries. {% for entry in entries %} {{ entry.index }} - {{ entry.timestamp }} + {{ entry.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} {{ entry.editgroup_id }} {{ entry.editgroup.editor_id }} {% if entry.editgroup.description != None %}{{ entry.editgroup.description }}{% endif %} diff --git a/python/fatcat_web/templates/changelog_view.html b/python/fatcat_web/templates/changelog_view.html index 1a758559..8c4684d5 100644 --- a/python/fatcat_web/templates/changelog_view.html +++ b/python/fatcat_web/templates/changelog_view.html @@ -7,7 +7,7 @@ -
Timestamp: {{ entry.timestamp }} +
Timestamp: {{ entry.timestamp.strftime("%Y-%m-%d %H:%M:%S") }}
Editgroup
{% endblock %} diff --git a/python/fatcat_web/templates/editgroup_view.html b/python/fatcat_web/templates/editgroup_view.html index f5a65be0..37771273 100644 --- a/python/fatcat_web/templates/editgroup_view.html +++ b/python/fatcat_web/templates/editgroup_view.html @@ -71,7 +71,7 @@ {% if editgroup.changelog_index %} Merged (Changelog #{{ editgroup.changelog_index }}) {% elif editgroup.submitted %} - Submitted ({{ editgroup.submitted }}) + Submitted ({{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }}) {% else %} Not Submitted {% endif %} diff --git a/python/fatcat_web/templates/editor_editgroups.html b/python/fatcat_web/templates/editor_editgroups.html index 7643981f..abfd9772 100644 --- a/python/fatcat_web/templates/editor_editgroups.html +++ b/python/fatcat_web/templates/editor_editgroups.html @@ -17,11 +17,11 @@ Description {% for editgroup in editgroups %} - {# {{ editgroup.created }} #} + {# {{ editgroup.created.strftime("%Y-%m-%d %H:%M:%S") }} #} {% if editgroup.changelog_index %} Merged
(#{{ editgroup.changelog_index }}) {% elif editgroup.submitted %} - Submitted
({{ editgroup.submitted }}) + Submitted
({{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }}) {% else %} Work in Progress {% endif %} diff --git a/python/fatcat_web/templates/release_changelog.html b/python/fatcat_web/templates/release_changelog.html deleted file mode 100644 index 706a5642..00000000 --- a/python/fatcat_web/templates/release_changelog.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "base.html" %} -{% block body %} - -

Release Changelog: {{ release.id }}

- -

release: {{ release.id }} - -

Changelog: -

- -{% endblock %} diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index d2078d13..fa157193 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -262,7 +262,7 @@ {% for webcapture in entity.webcaptures %} {{ webcapture.original_url }} -
{{ webcapture.timestamp }} | {{ webcapture.cdx|count }} resources +
{{ webcapture.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} | {{ webcapture.cdx|count }} resources
webcapture:{{ webcapture.ident }} {% for url in webcapture.archive_urls[:5] %} diff --git a/python/fatcat_web/templates/stats.html b/python/fatcat_web/templates/stats.html index f11ca820..d117e1a4 100644 --- a/python/fatcat_web/templates/stats.html +++ b/python/fatcat_web/templates/stats.html @@ -7,7 +7,7 @@ You can also fetch these numbers as JSON.

Changelog

-

Latest changelog index is {{ stats.changelog.latest.index }} ({{ stats.changelog.latest.timestamp[:10] }}). +

Latest changelog index is {{ stats.changelog.latest.index }} ({{ stats.changelog.latest.timestamp.strftime("%Y-%m-%d %H:%M:%S") }}).

Entities

diff --git a/python/fatcat_web/templates/webcapture_view.html b/python/fatcat_web/templates/webcapture_view.html index a6c628d9..921d5d48 100644 --- a/python/fatcat_web/templates/webcapture_view.html +++ b/python/fatcat_web/templates/webcapture_view.html @@ -43,7 +43,7 @@ {{ row.url}}
- {{ row.timestamp }} + {{ row.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} {% if row.mimetype %}| {{ row.mimetype }}{% endif %}
@@ -72,7 +72,7 @@ No known public archive for this webcapture. {% if webcapture.timestamp != None %}
-

Capture Time  {{ webcapture.timestamp }} +

Capture Time  {{ webcapture.timestamp.strftime("%Y-%m-%d %H:%M:%S") }}

{% endif %} -- cgit v1.2.3 From ca59441dab7bd99645c98c03dceb314c5d9fae5d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 3 Apr 2019 19:29:16 -0700 Subject: small UI tweaks for editgroups/account --- python/fatcat_web/routes.py | 9 +++++++-- python/fatcat_web/templates/auth_account.html | 2 +- python/fatcat_web/templates/base.html | 2 +- python/fatcat_web/templates/changelog.html | 23 ++++++++++++++++------ .../fatcat_web/templates/editgroup_reviewable.html | 20 +++++++++++++------ python/fatcat_web/templates/editgroup_view.html | 2 +- python/fatcat_web/templates/editor_editgroups.html | 10 +++++++--- python/fatcat_web/templates/editor_view.html | 2 +- 8 files changed, 49 insertions(+), 21 deletions(-) (limited to 'python/fatcat_web/templates/editor_editgroups.html') diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index e20cd3c5..bce3c529 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -425,6 +425,9 @@ def editor_editgroups(ident): try: editor = api.get_editor(ident) editgroups = api.get_editor_editgroups(ident, limit=50) + # cheaper than API-side expand? + for eg in editgroups: + eg.editor = editor except ApiException as ae: abort(ae.status) return render_template('editor_editgroups.html', editor=editor, @@ -434,7 +437,7 @@ def editor_editgroups(ident): def changelog_view(): try: #limit = int(request.args.get('limit', 10)) - entries = api.get_changelog() + entries = api.get_changelog() # TODO: expand="editors" except ApiException as ae: abort(ae.status) return render_template('changelog.html', entries=entries) @@ -444,6 +447,8 @@ def changelog_entry_view(index): try: entry = api.get_changelog_entry(int(index)) entry.editgroup.editor = api.get_editor(entry.editgroup.editor_id) + entry.editgroup.annotations = \ + api.get_editgroup_annotations(entry.editgroup_id, expand="editors") except ApiException as ae: abort(ae.status) return render_template('changelog_view.html', entry=entry, editgroup=entry.editgroup) @@ -452,7 +457,7 @@ def changelog_entry_view(index): def reviewable_view(): try: #limit = int(request.args.get('limit', 10)) - entries = api.get_editgroups_reviewable() + entries = api.get_editgroups_reviewable(expand="editors") except ApiException as ae: abort(ae.status) return render_template('editgroup_reviewable.html', entries=entries) diff --git a/python/fatcat_web/templates/auth_account.html b/python/fatcat_web/templates/auth_account.html index 8a251042..4b1562d7 100644 --- a/python/fatcat_web/templates/auth_account.html +++ b/python/fatcat_web/templates/auth_account.html @@ -2,7 +2,7 @@ {% block body %}

- + Account Settings

diff --git a/python/fatcat_web/templates/base.html b/python/fatcat_web/templates/base.html index 37641c90..fa5f8f7f 100644 --- a/python/fatcat_web/templates/base.html +++ b/python/fatcat_web/templates/base.html @@ -62,7 +62,7 @@ {# Edits in Progress #} Edit History
- Account + Account Logout
diff --git a/python/fatcat_web/templates/changelog.html b/python/fatcat_web/templates/changelog.html index 0d4ae657..7d5505bc 100644 --- a/python/fatcat_web/templates/changelog.html +++ b/python/fatcat_web/templates/changelog.html @@ -8,16 +8,27 @@ Limited to the most recent entries. {% for entry in entries %} -
Changelog
Index -
Timestamp (UTC) Editgroup - Editor Description
{{ entry.index }} - {{ entry.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} - {{ entry.editgroup_id }} - {{ entry.editgroup.editor_id }} +
#{{ entry.index }} +
{{ entry.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} +
+ {# + {% if entry.editgroup.editor.is_bot %} + + {% else %} + + {% endif %} + #} + Editor: + {{ entry.editgroup.editor_id[:8] }}... + +
+ + {{ entry.editgroup.editgroup_id }} +
{% if entry.editgroup.description != None %}{{ entry.editgroup.description }}{% endif %} {% endfor %}
diff --git a/python/fatcat_web/templates/editgroup_reviewable.html b/python/fatcat_web/templates/editgroup_reviewable.html index f3d75353..b1ece6af 100644 --- a/python/fatcat_web/templates/editgroup_reviewable.html +++ b/python/fatcat_web/templates/editgroup_reviewable.html @@ -7,15 +7,23 @@ Limited to the most recent entries. - {% for editgroup in entries %} -
Submitted (UTC) - Editgroup - Editor +
Editgroup Description
{{ editgroup.submitted }} - {{ editgroup.editgroup_id }} - {{ editgroup.editor_id }} +
+ {% if editgroup.editor.is_bot %} + + {% else %} + + {% endif %} + {{ editgroup.editor.username }} +
+ Submitted: {{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }} +
+ + {{ editgroup.editgroup_id }} +
{% if editgroup.description != None %}{{ editgroup.description }}{% endif %} {% endfor %}
diff --git a/python/fatcat_web/templates/editgroup_view.html b/python/fatcat_web/templates/editgroup_view.html index 31f9026f..f7f3ad45 100644 --- a/python/fatcat_web/templates/editgroup_view.html +++ b/python/fatcat_web/templates/editgroup_view.html @@ -131,7 +131,7 @@ reviewable bundle. None! {% endfor %} -{% if auth_to.annotate and not editgroup.changelog_index %} +{% if not editgroup.changelog_index and auth_to.annotate %}

Add Comment

diff --git a/python/fatcat_web/templates/editor_editgroups.html b/python/fatcat_web/templates/editor_editgroups.html index abfd9772..3c3dd20d 100644 --- a/python/fatcat_web/templates/editor_editgroups.html +++ b/python/fatcat_web/templates/editor_editgroups.html @@ -19,13 +19,17 @@ {% for editgroup in editgroups %} {# {{ editgroup.created.strftime("%Y-%m-%d %H:%M:%S") }} #} {% if editgroup.changelog_index %} - Merged
(#{{ editgroup.changelog_index }}) + Merged +
#{{ editgroup.changelog_index }} {% elif editgroup.submitted %} - Submitted
({{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }}) + Submitted +
{{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }} {% else %} Work in Progress {% endif %} - {{ editgroup.editgroup_id }} + + {{ editgroup.editgroup_id }} + {% if editgroup.description != None %}{{ editgroup.description }}{% endif %} {% endfor %} diff --git a/python/fatcat_web/templates/editor_view.html b/python/fatcat_web/templates/editor_view.html index 4d94ceaf..000922c0 100644 --- a/python/fatcat_web/templates/editor_view.html +++ b/python/fatcat_web/templates/editor_view.html @@ -7,6 +7,6 @@
-

View editor's editgroups +

Edit History {% endblock %} -- cgit v1.2.3