Add scheduled debate date to awaiting debate petitions view#456
Conversation
| end | ||
|
|
||
| def to_be_debated_on_in_words(date) | ||
| return unless date.present? |
There was a problem hiding this comment.
By doing the checking for the debate date here you end up with and empty <p> tag which is undesirable - we should use scheduled_debate_date? on the petition in the view and remove this check. E.g:
<% if petition.scheduled_debate_date? %>
<p><%= to_be_debated_on_in_words(petition.scheduled_debate_date) %></p>
<% end %>|
Other than the comments it looks 👍 @henryhadlow do we want to do relative dates, eg. 'To be debated today', 'To be debated tomorrow' ? |
|
@pixeltrix tks for replying.. I agree.. and I'm making the changes right now and waiting for @henryhadlow reply. 👍 |
| end | ||
|
|
||
| def to_be_debated_on_in_words(date) | ||
| def to_be_debated_on_in_words(date, today = Date.today) |
There was a problem hiding this comment.
Needs to be Date.current to take account of application timezone
| end | ||
|
|
||
| def to_be_debated_on_in_words(date, today = Date.current) | ||
| return unless date.present? |
There was a problem hiding this comment.
You don't need this check here now since we're checking in the view for the presence of the date
There was a problem hiding this comment.
Yes I agree.. sorry, I forgot to remove it.. but it's all done now.. commit 4700c6f 👍 😄 tks
|
@leandroalemao thanks! |
|
@pixeltrix, I'm glad to see you've merged my pull request.. 👍 😄 I'm willing to contribute more and more. Tks! |
|
@leandroalemao it was a pleasure - if you're looking for something else to work on then #450 is a nice and easy one but if you're looking for something a bit deeper then #458 should be interesting. Feel free to ask questions if you need anything clarifying. |
Hi people,
I've added the debate schedule date to the awaiting debate petitions view. Useful to check the debate date before clicking on the petition.