-
Notifications
You must be signed in to change notification settings - Fork 92
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
Choose duration for tomato #291
Closed
matheussilvasantos
wants to merge
11
commits into
tomatoes-app:master
from
matheussilvasantos:choose-tomato-duration
Closed
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f553728
Choose duration for tomato
matheussilvasantos c340e2f
Update tomato duration to Integer
matheussilvasantos 4af4425
Fix chosen duration time
matheussilvasantos e1371ba
Fix tomato page to use tomato duration
matheussilvasantos 8bc7727
Create tomato with duration on the tests
matheussilvasantos 906a81a
Set duration to seconds if it is in development
matheussilvasantos 6742f88
Update timer's duration output element
matheussilvasantos 484a1cb
Use durations set in tomato on duration input
matheussilvasantos 621699b
Remove unnecessary spacing
matheussilvasantos d42a1f9
Update must_not_overlap to use custom duration
matheussilvasantos 21b4ce4
Return duration to minutes on development
matheussilvasantos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module TomatoesParams | ||
def resource_params | ||
params.permit(tomato: [:tag_list]).require(:tomato) | ||
params.permit(tomato: [:tag_list, :duration]).require(:tomato) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module TomatoesHelper | ||
def tomato_duration(tomato) | ||
"#{(tomato.created_at - Tomato::DURATION).strftime('%I:%M %p')} - #{tomato.created_at.strftime('%I:%M %p')}" | ||
"#{(tomato.created_at - tomato.duration.to_i.minutes).strftime('%I:%M %p')} - #{tomato.created_at.strftime('%I:%M %p')}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,4 +65,15 @@ | |
<div id="start_container" class="center-block"> | ||
<%= link_to t('timer.start'), '#', id: 'start', class: 'btn btn-default btn-lg' %> | ||
<p id="start_hint" class="help-block"><%= t('timer.or_press_space') %></p> | ||
<div class="form-group" style="width: 50%; margin: 0 auto;"> | ||
<input name="duration_time" | ||
id="duration_time_input" | ||
class="form-control" | ||
type="range" | ||
min="5" | ||
max="60" | ||
value="5" | ||
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. Default value should be 25. |
||
oninput="duration_time_output.value = duration_time_input.value"> | ||
<output style="display: inline-block;" name="duration_time_output" id="duration_time_output">5</output> | ||
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. It would be more clear if we add a label, duration, and a unit of measurement, minutes. |
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why not
Integer
?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.
Yes, I've seen it after do the pull request, should be Integer