Add "how you found us" summary to the chapter admin page#2466
Add "how you found us" summary to the chapter admin page#2466olleolleolle merged 4 commits intocodebar:masterfrom
Conversation
0869e8c to
a58f9cb
Compare
|
One tiny issue - could you fixup that last commit? I think it's a variable introduced in this PR, so it should be simple enough to squash. Otherwise this is awesome. Have you thought about a release note to drop in the organisers chat? |
|
This looks great! Looking at things from the perspective of a chapter organiser, is there something you would want them to do with this information. ie. is there a call to action? Or is this only informational? Also, looking at the code it looks like this new section is currently above the section that shows upcoming workshops. Would it be possible to swap the order? I think the list of upcoming workshops is likely to be the more frequently needed information for day to day use. |
|
@biggianteye Nothing necessarily needs to be done with this information but I think it will help organisers know how people are finding out about codebar so they can continue to put efforts into that stream. For example, if they know flyers are bringing people to codebar keep distributing them. If it's social media, keep doing that. |
100% agree, please put something in the organisers channel when this is live as it's AWESOME! |
38074f0 to
4a06f90
Compare
|
Thanks for checking, but you can ignore me! I misread the code. The layout as it is, is fine. Sorry for the disraction. |
acc8b62 to
8e0dcbb
Compare
this is a preparatory step before adding a sidebar card that will show a summary of how members found this chapter (based on the responses to the "How did you find out about us" question that's asked during signup). before adding that card we want to ensure all existing sidebar content inside a card.
for large: cards are shown in a sidebar for medium: cards are shown next to each other, above the main column for small: cards are shown vertically one on top of the other so we need some horizontal spacing between cards for medium and some vertical spacing between cards for small.
reduce space between sidebar and main column on the chapter admin page offsetting by a column was introducing quite a lot of horizontal space between the two columns so we can reduce this and create more space for the content.
add a card to the sidebar on the chapter admin page that shows a summary of the responses to the "How did you find out about us" question that members are asked during signup.
8e0dcbb to
e3f4039
Compare
| @@ -0,0 +1,49 @@ | |||
| class HowYouFoundUsPresenter | |||
|
|
|||
There was a problem hiding this comment.
Minor: not a blocker.
| exact = (count / total_responses.to_f) * 100 | ||
| percentage_value = exact.floor | ||
| remainder = exact - percentage_value | ||
| { how: how, percentage_value: percentage_value, remainder: remainder } |
There was a problem hiding this comment.
| { how: how, percentage_value: percentage_value, remainder: remainder } | |
| { how:, percentage_value:, remainder: } |
I assume we are running a new-enough Ruby to use the "omit value in Hash when the local variable name matches the Hash key".
| private | ||
|
|
||
| def raw_stats | ||
| @stats ||= @chapter.members.where.not(how_you_found_us: nil).group(:how_you_found_us).count |
There was a problem hiding this comment.
Style detail: It is conventional to use the same name for the method and the memoizing instance variables (here raw_stats/stats do no match up).

Add a card to the sidebar on the chapter admin page that shows a summary of the responses to the "How did you find out about us" question that members are asked during signup.