diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-03 19:29:16 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-03 19:29:16 -0700 |
commit | ca59441dab7bd99645c98c03dceb314c5d9fae5d (patch) | |
tree | c51b0139b1c3660e7d863edb949c4d1e958d9df9 /python | |
parent | 526ee41b187a2373c08679bc9bc582679beaa9ef (diff) | |
download | fatcat-ca59441dab7bd99645c98c03dceb314c5d9fae5d.tar.gz fatcat-ca59441dab7bd99645c98c03dceb314c5d9fae5d.zip |
small UI tweaks for editgroups/account
Diffstat (limited to 'python')
-rw-r--r-- | python/fatcat_web/routes.py | 9 | ||||
-rw-r--r-- | python/fatcat_web/templates/auth_account.html | 2 | ||||
-rw-r--r-- | python/fatcat_web/templates/base.html | 2 | ||||
-rw-r--r-- | python/fatcat_web/templates/changelog.html | 23 | ||||
-rw-r--r-- | python/fatcat_web/templates/editgroup_reviewable.html | 20 | ||||
-rw-r--r-- | python/fatcat_web/templates/editgroup_view.html | 2 | ||||
-rw-r--r-- | python/fatcat_web/templates/editor_editgroups.html | 10 | ||||
-rw-r--r-- | python/fatcat_web/templates/editor_view.html | 2 |
8 files changed, 49 insertions, 21 deletions
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 %} <h1 class="ui header"> - <i class="user icon"></i> + <i class="settings icon"></i> Account Settings </h1> 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 @@ {# <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> <div class="divider"></div> - <a class="item" href="/auth/account"><i class="user icon"></i>Account</a> + <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> </div> </div> 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. <table class="ui table"> <thead><tr><th>Changelog<br>Index - <th>Timestamp (UTC) <th>Editgroup - <th>Editor <th>Description <tbody> {% for entry in entries %} - <tr><td><a href="/changelog/{{ entry.index }}">{{ entry.index }}</a> - <td>{{ entry.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} - <td><a href="/editgroup/{{ entry.editgroup_id }}">{{ entry.editgroup_id }}</a> - <td><a href="/editor/{{ entry.editgroup.editor_id }}">{{ entry.editgroup.editor_id }}</a> + <tr><td><a href="/changelog/{{ entry.index }}">#{{ entry.index }}</a> + <br>{{ entry.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} + <td> + {# + {% if entry.editgroup.editor.is_bot %} + <i class="icon bug"></i> + {% else %} + <i class="icon user"></i> + {% endif %} + #} + Editor: <code><a href="/editor/{{ entry.editgroup.editor_id }}"> + {{ entry.editgroup.editor_id[:8] }}...</a> + </a></code> + <br> + <small><code><a href="/editgroup/{{ entry.editgroup.editgroup_id }}"> + {{ entry.editgroup.editgroup_id }} + </a></code></small> <td>{% if entry.editgroup.description != None %}{{ entry.editgroup.description }}{% endif %} {% endfor %} </table> 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. <table class="ui table"> - <thead><tr><th>Submitted (UTC) - <th>Editgroup - <th>Editor + <thead><tr><th>Editgroup <th>Description <tbody> {% for editgroup in entries %} - <tr><td>{{ editgroup.submitted }} - <td><a href="/editgroup/{{ editgroup.editgroup_id }}">{{ editgroup.editgroup_id }}</a> - <td><a href="/editor/{{ editgroup.editor_id }}">{{ editgroup.editor_id }}</a> + <tr><td> + {% if editgroup.editor.is_bot %} + <i class="icon bug"></i> + {% else %} + <i class="icon user"></i> + {% endif %} + <a href="/editor/{{ editgroup.editor_id }}">{{ editgroup.editor.username }}</a> + <br> + Submitted: {{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }} + <br> + <small><code><a href="/editgroup/{{ editgroup.editgroup_id }}"> + {{ editgroup.editgroup_id }} + </a></code></small> <td>{% if editgroup.description != None %}{{ editgroup.description }}{% endif %} {% endfor %} </table> 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. <i>None!</i> {% endfor %} -{% if auth_to.annotate and not editgroup.changelog_index %} +{% if not editgroup.changelog_index and auth_to.annotate %} <div class="ui segment"> <h3 class="ui header">Add Comment</h3> <form class="ui form" id="submit_editgroup_annotation_form" method="POST" action="/editgroup/{{ editgroup.editgroup_id }}/annotation"> 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 %} <tr>{# <td>{{ editgroup.created.strftime("%Y-%m-%d %H:%M:%S") }} #} <td>{% if editgroup.changelog_index %} - Merged<br>(<a href="/changelog/{{ editgroup.changelog_index }}">#{{ editgroup.changelog_index }}</a>) + Merged + <br><a href="/changelog/{{ editgroup.changelog_index }}">#{{ editgroup.changelog_index }}</a> {% elif editgroup.submitted %} - Submitted<br>({{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }}) + Submitted + <br>{{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }} {% else %} Work in Progress {% endif %} - <td><code><a href="/editgroup/{{ editgroup.editgroup_id }}">{{ editgroup.editgroup_id }}</a></code> + <td><small><code><a href="/editgroup/{{ editgroup.editgroup_id }}"> + {{ editgroup.editgroup_id }} + </a></code></small> <td>{% if editgroup.description != None %}{{ editgroup.description }}{% endif %} {% endfor %} </table> 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 @@ </div> </h1> -<p><b><a href="/editor/{{ editor.editor_id }}/editgroups">View editor's editgroups</a></b> +<p><b><a href="/editor/{{ editor.editor_id }}/editgroups">Edit History</a></b> {% endblock %} |