forked from sparc-request/sparc-request
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Jl form functionality cleanup #157
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4b33116
Converting from military time. Still need to add am/pm.
jleonardw9 0af5194
Adding in the am/pm.
jleonardw9 fb31334
Cleanup
jleonardw9 f106c48
Allowing multiple values for the checkboxs. Getting values to display…
jleonardw9 c27070d
Adding back in the checkbox option.
jleonardw9 e900204
fix for viewing checkboxes on edit
8a903a4
Forgot to account for 10 and 11 AM.
jleonardw9 343f10f
Using built in tool for dealing with am/pm for converting military time.
jleonardw9 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
module AdditionalDetails::ApplicationHelper | ||
|
||
def convert_time(time) | ||
DateTime.strptime(time, '%H:%M').strftime('%l:%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
2 changes: 1 addition & 1 deletion
2
app/views/additional_details/submissions/form_partials/_checkbox_form_partial.html.haml
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 @@ | ||
%br | ||
- item.item_options.each do |item_option| | ||
= qr.label :content, class: 'checkbox-inline' do | ||
= qr.check_box :content, {}, item_option.content, nil | ||
= qr.check_box :content, { multiple: true, checked: (qr.object.content.include?(item_option.content) unless qr.object.content.nil?)}, item_option.content, nil | ||
= item_option.content |
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.
I tested
qr.content.delete('[]').delete('\"')
andqr.content.gsub(/["\[\]]/, '')
and they appear to be doing the same thing: Replacing/removing the characters []". We should combine this block and the if block into a single statement.if ['checkbox', 'multiple_dropdown'].include?(item.item_type)
qr.content.delete('[]\"')
orqr.content.gsub(/["\[\]]/, '')
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.
I would label that a refactor and make another pull request. Not necessary to proceed. In the same thought you could change 'qr.content.gsub' to another method call similar to convert_time.
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.
Fair enough.