{% block subnav %}{% endblock %}
{% if title %}
+ {% for i, (participant, excerpts) in enumerate(participants_and_excerpts, start=1) %}
+
+{% endmacro %}
diff --git a/www/assets/gratipay.css.spt b/www/assets/gratipay.css.spt
index 26b96b2531..30ea3a2ebe 100644
--- a/www/assets/gratipay.css.spt
+++ b/www/assets/gratipay.css.spt
@@ -53,7 +53,6 @@
@import "scss/fragments/accounts";
@import "scss/fragments/members";
-@import "scss/fragments/mini-user";
@import "scss/fragments/notifications";
@import "scss/fragments/pagination";
diff --git a/www/index.html.spt b/www/index.html.spt
index 3400824913..6033f7df2b 100644
--- a/www/index.html.spt
+++ b/www/index.html.spt
@@ -104,7 +104,7 @@ page_id = "homepage"
{{ team.name }}
-
{{ title }}
{% endif %} {% block content %}{% endblock %} diff --git a/templates/list-participants.html b/templates/list-participants.html new file mode 100644 index 0000000000..1fc18c6a72 --- /dev/null +++ b/templates/list-participants.html @@ -0,0 +1,29 @@ +{% from 'templates/avatar-url.html' import avatar_url, avatar_img with context %} +{% macro list_participants(participants_and_excerpts, show_emails) %} +
+ {{ avatar_img(participant) }}
+ {{ participant.username }}
+
+
+ {{ i }}
+ · {{ _("joined {ago}",
+ ago=to_age(participant.claimed_time, add_direction=True)) }}
+ {% if show_emails %}·
+ {{
+ participant.email_address }}{% endif %}
+ {% if excerpts %}
+
+ {{ process_excerpt('… ' + excerpts[0]['excerpt'] + ' …') }}
+
+ {% else %}
+ {{ get_processed_excerpt(participant) }}
+ {% endif%}
+
+ |
+
+
{{ i }}
·
-
-
-
-{% endblock %}
-
+{% from 'templates/list-participants.html' import list_participants with context %}
{% block content %}
- {% set usernames = results.get('usernames') %}
+
+
+ {% set usernames = zip(results.get('usernames', []), empty_excerpts()) %}
{% set statements = results.get('statements') %}
- {% set emails = results.get('emails') %}
+ {% set emails = zip(results.get('emails', []), empty_excerpts()) %}
{% set projects = results.get('projects') %}
{% if projects %}
-
-
{{ ngettext("Found a matching project name", - "Found matching project names", - len(projects)) }}
-
- {% for result in projects %}
-
-
-
- {{ result.name }}
+
+ {% for i, team in enumerate(projects, start=1) %}
+
{% endif %}
{% if usernames %}
-
{{ ngettext("Found a matching project", + "Found matching projects", + len(projects)) }}
+
+
+ {{ team.name }}
+
+
+ {{ i }}
+ ·
+ {{ status_icons[team.status]|safe }}{{ i18ned_statuses[team.status] }}
+
+ · {{ _("created {ago}",
+ ago=to_age(team.ctime, add_direction=True)) }}
+ ·
+ {{ _( "owned by {a}{owner}{_a}"
+ , owner='~'+team.owner
+ , a=(''|safe).format(team.owner)
+ , _a=''|safe
+ ) }}
+
-
+
+ {% if team.status == 'approved' %}
+
|
+
{{ ngettext("Found a matching username", - "Found matching usernames", - len(usernames)) }}
-
- {% for result in usernames %}
-
-
-
- {{ result.username }}
-
-
- {% endfor %}
-
+ {{ ngettext("Found a matching username", + "Found matching usernames", + len(usernames)) }}
+ {{ list_participants(usernames) }} {% endif %} {% if statements %} -
-
+ {{ ngettext("Found a matching user statement", - "Found matching user statements", - len(statements)) }}
- {% for result in statements %} -
- {{ avatar_img(result) }}
-
- {% endfor %}
-
- {{ result.username }}
- {% if len(result.excerpts) == 1 %}
-
- {{ - markdown.render(result.excerpts[0].excerpt) - }}- {% endif %} -
{{ ngettext("Found a matching user statement", + "Found matching user statements", + len(statements)) }}
+ {{ list_participants(statements, extract_statement) }} {% endif %} {% if emails %} -{{ ngettext("Found a matching email address", - "Found matching email addresses", - len(usernames)) }}
-
- {% for result in emails %}
-
-
-
- {{ result.username }}
-
-
- {% endfor %}
-
+ {{ ngettext("Found a matching email address", + "Found matching email addresses", + len(emails)) }}
+ {{ list_participants(emails, show_emails=True) }} {% endif %} {% if query and not (usernames or statements or emails or projects) %} -{{ _("Sorry, we didn't find anything matching your query.") }}
+{{ _("Sorry, we didn't find anything matching your query.") }}
{% endif %} {% endblock %} - -{% block scripts %} - -{% endblock %} [---] application/json via json_dump results