-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
Search Form Template #3976
Search Form Template #3976
Conversation
* Search Form WIP * popup_menu wip * Search Form Templatization * Removed commented code
templates/search_form.tt.html
Outdated
<select name="tagtype_${type.id}" id="tagtype_${type.id}"> | ||
[% FOREACH value IN type.type_arrays %] | ||
[% IF value.type_labels == 'choose a criterion...' %] | ||
<option value="[% value.type_values %]" label="[% value.type_labels %]" selected="selected"></option> |
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.
The selected value is not necessarily the first one. You probably need to compare value.type_value to the type_value variable you are also passing:
push @{$template_data_ref->{criteria}}, {
id => $i,
type_value => $search_tags[$i][0],
type_arrays => \@type_array,
contain_value => $search_tags[$i][1],
contain_array => \@contains,
input_value => $search_tags[$i][2],
};
Maybe to make it clearer:
- type_value could be renamed to selected_type_value
- type_arrays could be renamed to type_options, with inside the array of { value => .. , label => .. }
Same for the other parts of the form below.
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.
Alright. I'll fix this
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
Looks good, thank you!
Description:
HTML Templatization of Search form using Template::Toolkit
Related issues and discussion: #2416