Committer: nefimenko
LJSUP-4703 1. "Upload" block on the Manage Userpics pageU trunk/htdocs/editpics.bml
Modified: trunk/htdocs/editpics.bml =================================================================== --- trunk/htdocs/editpics.bml 2009-08-13 09:02:18 UTC (rev 15600) +++ trunk/htdocs/editpics.bml 2009-08-13 09:03:28 UTC (rev 15601) @@ -569,12 +569,15 @@ # print out upload pic box my $emit_upload_box = sub { $body .= '<a name="uploadBox"></a>'; - if (scalar @userpics < $max) { + # if (scalar @userpics < $max) { # upload form (with perlbal upload-tracking) $body .= qq { <iframe name='upiframe' width='1' height='1' style='border: none'></iframe> - <div id='uploadBox' class='pkg'><div id='uploadBox-inner'> + <div id='uploadBox' class='pkg}; + if (scalar @userpics > $max) { $body .=' st-disabled'; } + $body .= qq { + '><div id='uploadBox-inner'> <form enctype="multipart/form-data" action="editpics$suffix.bml$getextra" method='post' id='uploadPic'> <input type="hidden" id="go_to" name="go_to" value="editpics$suffix.bml$getextra" /> }; @@ -599,13 +602,17 @@ 'class' => 'radio', 'value' => 'file', 'selected' => '1', 'accesskey' => $ML{'.fromfile.key'} }) . "\n"; $body .= "<label for='radio_file'>$ML{'.fromfile'}</label><br />\n"; - $body .= "<input type='file' class='file' name='userpic' size='22' style='margin: 0em 0em 0.5em 2em;' />\n"; + $body .= "<input type='file' class='file' name='userpic' size='22'"; + if (scalar @userpics > $max) { + $body .= "disabled='disabled' "; + } + $body .= " style='margin: 0em 0em 0.5em 2em;' />\n"; $body .= "</p>\n"; $body .= "<p class='pkg'>\n"; $body .= LJ::html_check({ 'type' => 'radio', 'name' => 'src', 'value' => 'url', 'id' => 'radio_url', 'class' => 'radio', 'accesskey' => $ML{'.fromurl.key'} }) . "\n"; $body .= "<label for='radio_url'>$ML{'.fromurl'}</label><br />\n"; - $body .= LJ::html_text({ 'name' => 'urlpic', class => 'text', style => 'margin: 0em 0em 0.5em 2em;' }) . "\n"; + $body .= LJ::html_text({ 'name' => 'urlpic', class => 'text', style => 'margin: 0em 0em 0.5em 2em;', disabled => scalar @userpics > $max }) . "\n"; $body .= "</p>\n"; $body .= "<p class='detail'>$ML{'.label.formats.desc'}</p>\n"; $body .= "</div>\n"; @@ -616,7 +623,7 @@ $body .= "<p class='pkg'>\n"; $body .= "<label class='left' for='keywords'>$ML{'.label.keywords'}</label>\n"; $body .= "<span class='input-wrapper'>"; - $body .= LJ::html_text({ 'name' => 'keywords', class => 'text', id => 'keywords' }) . "\n"; + $body .= LJ::html_text({ 'name' => 'keywords', class => 'text', id => 'keywords', disabled => scalar @userpics > $max }) . "\n"; $body .= LJ::help_icon_html('upic_keywords') . "\n"; $body .= "</span>"; $body .= "</p>\n"; @@ -627,7 +634,7 @@ $body .= "<label class='left' for='comments'>$ML{'.label.comment'}</label>\n"; my $comments = $fotobilder ? $POST{'comments'} : undef; $body .= "<span class='input-wrapper'>"; - $body .= LJ::html_text({ 'name' => 'comments', 'class' => 'text', id => 'comments', 'maxlength' => LJ::CMAX_UPIC_COMMENT, 'value', $comments }) . "\n"; + $body .= LJ::html_text({ 'name' => 'comments', 'class' => 'text', id => 'comments', 'maxlength' => LJ::CMAX_UPIC_COMMENT, 'value', $comments, disabled => scalar @userpics > $max }) . "\n"; $body .= LJ::help_icon_html('upic_comments') . "\n"; $body .= "</span>"; $body .= "</p>\n"; @@ -640,6 +647,7 @@ 'id' => 'make_default', 'value' => '1', 'selected' => @userpics ? 0 : 1, + 'disabled' => scalar @userpics > $max, 'accesskey' => $ML{'.makedefault.key'} }); $body .= "<label for='make_default'>$ML{'.makedefault'}</label>\n"; @@ -651,12 +659,13 @@ $body .= "</p>\n"; $body .= q { </form> - </div></div><!-- end #uploadBox --> + </div><div class="b-blocker b-blocker-white"></div></div><!-- end #uploadBox --> <div id="uploadStatus" style="display: none;"></div> <div id="progressBar" style="display: none;"></div> }; - } else { + # } else { + if (scalar @userpics > $max) { $body .= "<div id='limit'>\n"; my $inline; if ($inline .= LJ::run_hook("cprod_inline", $u, 'EditPicsMax')) {