Skip to content

Commit

Permalink
support: Show the first human user in realm search result.
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerkid authored and timabbott committed Apr 16, 2021
1 parent e72dea1 commit ab771e4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions analytics/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,11 @@ def check_polonius_user_query_result(result: HttpResponse) -> None:

def check_zulip_realm_query_result(result: HttpResponse) -> None:
zulip_realm = get_realm("zulip")
first_human_user = zulip_realm.get_first_human_user()
assert first_human_user is not None
self.assert_in_success_response(
[
f"<b>First human user</b>: {first_human_user.delivery_email}\n",
f'<input type="hidden" name="realm_id" value="{zulip_realm.id}"',
"Zulip Dev</h3>",
'<option value="1" selected>Self hosted</option>',
Expand Down
5 changes: 5 additions & 0 deletions static/styles/portico/activity.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ tr.admin td:first-child {
top: -2px;
}

.support-realm-status-form {
position: relative;
top: 20px;
}

.support-discount-form {
position: relative;
top: -50px;
Expand Down
13 changes: 12 additions & 1 deletion templates/analytics/realm_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ <h3><img src="{{ realm_icon_url(realm) }}" class="support-realm-icon"> {{ realm.
<i class="fa fa-copy"></i>
</a>
{% endif %}
<form method="POST">
<br>
{% set first_human_user = realm.get_first_human_user() %}
{% if first_human_user %}
<b>First human user</b>: {{ first_human_user.delivery_email }}
<a title="Copy emails" class="copy-button" data-copytext="{{ first_human_user.delivery_email }}">
<i class="fa fa-copy"></i>
</a>
{% else %}
<b>First human user</b>:
{% endif %}

<form method="POST" class="support-realm-status-form">
<b>Status</b>:<br>
{{ csrf_input }}
<input type="hidden" name="realm_id" value="{{ realm.id }}" />
Expand Down

0 comments on commit ab771e4

Please sign in to comment.