Commit bc3cc6a2ebf013d7aaad656a949fb3ce641c9330
Committed by
Fabio Teixeira
1 parent
f8a93d80
Exists in
master
and in
5 other branches
Add maxlenght validation to software fields
Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com> Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
lib/database_helper.rb
@@ -58,13 +58,13 @@ module DatabaseHelper | @@ -58,13 +58,13 @@ module DatabaseHelper | ||
58 | 58 | ||
59 | content_tag('tr', | 59 | content_tag('tr', |
60 | content_tag('td', label_tag(_("Version")))+ | 60 | content_tag('td', label_tag(_("Version")))+ |
61 | - content_tag('td', text_field_tag("database[][version]", database_data[:version]))+ | 61 | + content_tag('td', text_field_tag("database[][version]", database_data[:version], :maxlength=>"20"))+ |
62 | content_tag('td') | 62 | content_tag('td') |
63 | )+ | 63 | )+ |
64 | 64 | ||
65 | content_tag('tr', | 65 | content_tag('tr', |
66 | content_tag('td', label_tag(_("Operating System")))+ | 66 | content_tag('td', label_tag(_("Operating System")))+ |
67 | - content_tag('td', text_field_tag("database[][operating_system]", database_data[:operating_system]))+ | 67 | + content_tag('td', text_field_tag("database[][operating_system]", database_data[:operating_system], :maxlength=>"20"))+ |
68 | content_tag('td', button_without_text(:delete, _('Delete'), "#" , :class=>"delete-dynamic-table"), :align => 'right') | 68 | content_tag('td', button_without_text(:delete, _('Delete'), "#" , :class=>"delete-dynamic-table"), :align => 'right') |
69 | ), :class => 'dynamic-table database-table' | 69 | ), :class => 'dynamic-table database-table' |
70 | ) | 70 | ) |
views/mpog_software_plugin_myprofile/_public_software_info.html.erb
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | <div class="formfield type-text"> | 3 | <div class="formfield type-text"> |
4 | <%= label_tag(:acronym ,_("Acronym"), :class=>"formlabel") %> | 4 | <%= label_tag(:acronym ,_("Acronym"), :class=>"formlabel") %> |
5 | - <%= text_field_tag("software[acronym]", @software_info.acronym) %> | 5 | + <%= text_field_tag("software[acronym]", @software_info.acronym, :maxlength=>"10") %> |
6 | </div> | 6 | </div> |
7 | 7 | ||
8 | <div class="formfieldline"> | 8 | <div class="formfieldline"> |
@@ -55,12 +55,12 @@ | @@ -55,12 +55,12 @@ | ||
55 | 55 | ||
56 | <div class="formfieldline"> | 56 | <div class="formfieldline"> |
57 | <%= label_tag "objectives", _("Objectives: ")%><br /> | 57 | <%= label_tag "objectives", _("Objectives: ")%><br /> |
58 | - <%= text_area_tag "software[objectives]", @software_info.objectives%> | 58 | + <%= text_area_tag "software[objectives]", @software_info.objectives, :maxlength=>"140"%> |
59 | </div> | 59 | </div> |
60 | 60 | ||
61 | <div class="formfieldline"> | 61 | <div class="formfieldline"> |
62 | <%= label_tag "features", _("Features: ")%><br /> | 62 | <%= label_tag "features", _("Features: ")%><br /> |
63 | - <%= text_area_tag "software[features]", @software_info.features %> | 63 | + <%= text_area_tag "software[features]", @software_info.features, :maxlength=>"4000" %> |
64 | </div> | 64 | </div> |
65 | 65 | ||
66 | <div id='libraries_fields'> | 66 | <div id='libraries_fields'> |