-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: User flow redesign #736
Changes from 12 commits
c7e1446
b379470
b651599
a9ac3ba
9fb02e6
3fe8699
f13d133
bb13080
30f1595
e31d551
31f96ed
b8bc48e
e452572
257af98
f9802d8
6810326
46a94de
bc504b7
94d5e9a
ef719f9
c526389
387086e
600cd9e
865d1e5
2850377
53d0461
696e40e
a0be4e0
96b6ebd
c95dccd
9b01e04
b2156ba
bafffc6
5c3ce7b
bd7c300
8ce34d5
f881aa1
58ff325
7bf355b
fd1c1df
390df30
76b0d98
d7fdb1c
739fa52
d5c7ce8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: ['sign-up'] }) do |f| %> | ||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name, @form_action_params), html: { class: ['sign-up'] }) do |f| %> | ||
<%= f.text_field :nickname, placeholder: 'First name (or nickname)', id: 'user_name', class: 'name', autofocus: true %> | ||
<%= f.email_field :email, placeholder: 'Email address', id: 'user_email', class: 'email' %> | ||
<%= f.password_field :password, placeholder: 'Password (at least 8 characters you won\'t forget!)', id: 'user_password', class: 'password' %> | ||
<%= f.select :home_city_id, @cities_set_with_blank, {disabled: '', selected: @selected_city}, id: 'user_home_city', class: 'home_city' %> | ||
<%= f.submit "Let's Get Tea", id: 'user_signup_submit', class: 'orange' %> | ||
<% end %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,8 +70,20 @@ | |
</button> | ||
<% end %> | ||
<% end %> | ||
<% elsif (no_signin_button ||= false) # No signin button; don't show signin CTA text %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the |
||
<%= link_to sign_up_path(redirect_to_tt: tea_time.id, city_id: tea_time.city.id) do %> | ||
<% if tea_time.spots_remaining? %> | ||
<button class="spots<%= tea_time.spots_remaining %>"> | ||
Count Me In | ||
</button> | ||
<% else %> | ||
<button class="yellow button"> | ||
Join Waitlist | ||
</button> | ||
<% end %> | ||
<% end %> | ||
<% else %> | ||
<%= link_to new_user_session_path do %> | ||
<%= link_to new_user_session_path(redirect_to_tt: tea_time.id) do %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<button class="yellow button"> | ||
Sign in to schedule | ||
</button> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<%= content_for :title do %>Tea Times | Tea With Strangers<% end %> | ||
|
||
<% next_month_name = Date.today.next_month.strftime("%B") %> | ||
|
||
<div class="cover-photo" style="background-image: linear-gradient(to bottom, rgba(247, 191, 77, 0.87), rgba(247, 191, 77, 0.87)), url('<%= image_path("missing-city-image.jpg") %>'); margin-bottom: 50px;"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Styles are inline because @ankitshah811 will do the CSS and I don't want to create classes that might be rewritten later. |
||
<%= render partial: 'shared/header' %> | ||
<div class="content"> | ||
<div class="content-box"> | ||
<h1 class="cover-photo-lede">Tea times this month</h1> | ||
<span class='cover-photo-subtext'> | ||
We announce tea times at the beginning of each month. | ||
If nothing this month fits you, | ||
<% if !user_signed_in? %>sign up and <% end %> | ||
we'll email you in <%= next_month_name %> about tea | ||
times then. | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="container"> | ||
<div class="light-background"> | ||
<div> | ||
<% if @tea_times_by_city.empty? %> | ||
<p> | ||
No tea times scheduled for this month! Check back later. | ||
</p> | ||
<% else %> | ||
<p> | ||
This month, there are tea times happening in <%= @cities.to_sentence %>. | ||
</p> | ||
<p> | ||
If you don't live in any of these places or the tea times below don't | ||
work for your schedule, we can try to make something work for you in | ||
<%= next_month_name %>. | ||
</p> | ||
<% end %> | ||
</div> | ||
<div> | ||
<% if user_signed_in? %> | ||
TODOCOPY None of these times work for you? We'll send out a newsletter in <%= next_month_name %> with the next month's tea times.</div> | ||
<% else %> | ||
<%= link_to sign_up_path(remind_next_month: 'yes') do %> | ||
<button>Email me in <%= next_month_name %></button> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
<% @tea_times_by_city.each do |city, tts| %> | ||
<div class="tt-set-container"> | ||
<div class="tt-container tt-city-name" style="border: 5px solid #EF6236; color: #EF6236; font-weight: bold; height: 200px; padding: 20px; font-size: 30px; text-transform: uppercase; text-align: center;"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above (Styles are inline because @ankitshah811 will do the CSS and I don't want to create classes that might be rewritten later.) |
||
<%= city %> | ||
</div> | ||
<% tts.each do |tt| %> | ||
<%= render partial: 'shared/tea_time_row', locals: {tea_time: tt, no_signin_button: true} %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are converting a list of tea times into a hash like:
along with a list of names in
@cities
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will return an array of
TeaTime
, not a hash. Additionally,this_month
isn't a standard AR Scope and it's not defined on the TT model, so you'll need something likewhere(:created_at => Time.now.beginning_of_month..Time.now.end_of_month)
instead I think. Might want to make the span a rolling 4 week period too so it doesn't weirdly cut over towards the end of a month?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickbarnwell
Re: array: Whoops, my bad for not being clear. I meant this comment to 'introduce' the following lines of code which are doing the process of converting that list to a hash.
Re: scope: I added a custom scope in the model, let me know if it looks right: https://github.com/TeaWithStrangers/tws-on-rails/pull/736/files#diff-c0448cf921e60c620dcf5c85c1718605R35
Re: rolling period: This was something Ankit requested in the spec - I think the idea was to have tea times come out in "batches" at the beginning of the month.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markbao @nickbarnwell
Re: rolling period — Mark is right on what I suggested in the spec. We discussed having following month's tea times be available with the click of a "Show Next Month's Tea Times" button. Not sure if we landed on a conclusion there. @markbao Do you remember?