From 0448f995f7a7bb1cce912a8d4ed358b7300020e6 Mon Sep 17 00:00:00 2001 From: aymm Date: Sat, 27 Mar 2021 21:15:07 +0100 Subject: [PATCH] Added user avatars next to their chosen option --- globals.php | 2 +- styles/style.css | 8 ++++++-- view_poll.php | 21 ++++++++++++++++----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/globals.php b/globals.php index 16e22e4..e7c504c 100644 --- a/globals.php +++ b/globals.php @@ -34,7 +34,7 @@ function get_page_header( } $script_str = ''; foreach ($scripts as $script) { - $script_str .= ''; } return ''.$title.'' . $script_str diff --git a/styles/style.css b/styles/style.css index 4dfe452..9dc67ca 100644 --- a/styles/style.css +++ b/styles/style.css @@ -60,8 +60,6 @@ header { } .poll .header { - /*display: flex; - align-items: center;*/ margin-bottom: 8px; } @@ -89,3 +87,9 @@ header { datewrapper time { grid-column: 2; } + +.options { + display: grid; + grid-template-columns: auto 1fr; + grid-column-gap: 8px; +} diff --git a/view_poll.php b/view_poll.php index e787d28..d4b4e39 100644 --- a/view_poll.php +++ b/view_poll.php @@ -35,14 +35,14 @@ try { . '' ); } - +jslog($poll); $user_avatar_url = $poll->user->getAvatarUrl(50); $username = '@' . $poll->user->username; $disabled = $poll->canVote() ? '' : 'disabled'; $user_name = $poll->user->name ?? ''; $created_at = $poll->created_at; $closed_at = $poll->closed_at; -jslog('teyt'); + ?>
@@ -68,11 +68,22 @@ jslog('teyt');
false, + 'include_counts' => false, + ]; foreach ($poll->options as $option) { $checked = $option->is_your_response ? 'checked' : ''; ?> -
- /> - text ?> +
+ /> + text . ' (' . $option->respondents . ')'?> +
+
+ respondent_ids as $res_id) { + $u = $api->getUser($res_id, $user_args); ?> + +