diff --git a/ddportfolioservice/templates/showform.mako b/ddportfolioservice/templates/showform.mako index 3ffbb36..a569927 100644 --- a/ddportfolioservice/templates/showform.mako +++ b/ddportfolioservice/templates/showform.mako @@ -42,6 +42,10 @@ ${h.form(h.url_for(action='urllist'), method='get')} ${h.text('email', h.escape(request.params.get('email', None), True), id='email')}
+
+ ${h.checkbox('showall', value='1', checked=False, id='showall')} +
+
. +var defaulthiddendivs = new Array( + '#gpgfpfield'); +var defaultreadonlydivs = new Array( + '#gpgfpfield'); +var maskedfielddivs = new Array( + '#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield', + '#aliothusernamefield'); +var allfielddivs = new Array( + '#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield', + '#aliothusernamefield'); + function updateFields(data, textStatus) { if (data.type == 2) { // DD $('#name').attr('value', data.name).attr('readonly', 'readonly'); @@ -66,7 +77,15 @@ function updateFields(data, textStatus) { } function onChangeShowAll(event) { - alert(event); + if ($('#showall').attr('checked')) { + for (var fielddiv in allfielddivs) { + $(allfielddivs[fielddiv]).show(); + } + } else { + for (var fielddiv in maskedfielddivs) { + $(maskedfielddivs[fielddiv]).hide(); + } + } } function onBlurEmail() { @@ -92,6 +111,14 @@ $(document).ready(function() { $(fields[index]).hide(); } } + for (var index in defaulthiddendivs) { + $(defaulthiddendivs[index]).hide(); + } + for (var index in defaultreadonlydivs) { + $(defaultreadonlydivs[index]).hide(); + } $('#email').blur(onBlurEmail).focus(); + $('#showall').attr('checked', false); + $('#showall').change(onChangeShowAll); });