# HG changeset patch # User Christophe Lincoln # Date 1333572054 -7200 # Node ID 74eb7fea1546d42a14737b921e51bbebd59d9320 # Parent 8d5eadf9ca7a410a2a95a16e497ac1375026549a Improve search function and login page, use placeholder and THANKS Paul for the corrections diff -r 8d5eadf9ca7a -r 74eb7fea1546 web/bugs.cgi --- a/web/bugs.cgi Wed Apr 04 20:03:49 2012 +0100 +++ b/web/bugs.cgi Wed Apr 04 22:40:54 2012 +0200 @@ -117,22 +117,12 @@
- - - - - - - - - - - - - - - -
$(gettext "User name")
$(gettext "Password")
$error
+ + +
+ + $error +
@@ -172,10 +162,9 @@ if [ "$PRIORITY" == "$pr" ]; then cat << EOT
-Bug title  : $BUG
+Bug title  : $BUG Show
 ID - Date  : $id - $DATE
-Creator    : $CREATOR - \
-Show Bug
+Creator    : $CREATOR
 
EOT fi @@ -392,7 +381,7 @@ echo "" } -# Create a new user +# Create a new user in AUTH_FILE and PEOPLE new_user_config() { mail="$(GET mail)" pass="$(GET pass)" @@ -466,6 +455,7 @@ error="$(gettext "Bad login or pass")" header html_header + user_box login_page html_footer ;; *\ logout\ *) @@ -581,17 +571,26 @@ -
+
EOT - IFS="/" - grep -i -H $(GET search) $bugdir/*/* | while read bug id file + + #found=0 JS to notify or write results nb under the search box. + for bug in $bugdir/* do - echo -n "Bug $id : " - echo $file | cut -d : -f 2 | \ - sed s"/$(GET search)/$(GET search)<\/span>/"g + result=$(fgrep -i "$(GET search)" $bug/*) + if [ "$result" ]; then + #found=$(($found + 1)) + id=${bug#bug/} + echo "

Bug $id $(gettext "Show")

" + echo '
'
+				fgrep -i "$(GET search)" $bugdir/$id/* | \
+					sed s"/$(GET search)/$(GET search)<\/span>/"g
+				echo '
' + else + gettext "

No result found for:"; echo " $(GET search)

" + fi done - unset IFS - echo '
' + echo '' html_footer ;; *) # Default page. @@ -629,8 +628,8 @@ fi cat << EOT
- - + +
EOT diff -r 8d5eadf9ca7a -r 74eb7fea1546 web/style.css --- a/web/style.css Wed Apr 04 20:03:49 2012 +0100 +++ b/web/style.css Wed Apr 04 22:40:54 2012 +0200 @@ -71,18 +71,18 @@ #content { margin: 40px auto; text-align: justify; - width: 720px; + max-width: 720px; } #login { - width: 280px; + width: 240px; float: left; height: 120px; } #login input[type="text"], #login input[type="password"], #tools input[type="text"] { - width: 180px; padding: 3px; } + width: 220px; padding: 3px; } #tools input[type="submit"] { padding: 3px; } #login input[type="submit"] { float: none; } @@ -96,7 +96,7 @@ } #user a { padding: 0 4px; } -#account-info { width: 380px; height: 120px; float: right; } +#account-info { width: 420px; height: 120px; float: right; } #newbug textarea { width: 460px; }