tazbug view web/bugs.cgi @ rev 51

Improve bug listing
author Christophe Lincoln <pankso@slitaz.org>
date Mon Jan 06 16:58:23 2014 +0000 (2014-01-06)
parents 02a11d8d636e
children 3acb15d87d6e
line source
1 #!/bin/sh
2 #
3 # TazBug Web interface
4 #
5 # Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License
6 #
7 . /usr/lib/slitaz/httphelper
8 [ -f "/etc/slitaz/bugs.conf" ] && . /etc/slitaz/bugs.conf
9 #. bugs.conf
11 # Internal variable
12 bugdir="$TAZBUG/bug"
13 plugins="plugins"
14 sessions="/tmp/bugs/sessions"
15 script="$SCRIPT_NAME"
16 po=""
18 # Content negotiation for Gettext
19 IFS=","
20 for lang in $HTTP_ACCEPT_LANGUAGE
21 do
22 lang=${lang%;*} lang=${lang# } lang=${lang%-*}
23 case "$lang" in
24 en) LANG="C" ;;
25 de) LANG="de_DE" ;;
26 es) LANG="es_ES" ;;
27 fr) LANG="fr_FR" ;;
28 it) LANG="it_IT" ;;
29 pt) LANG="pt_BR" ;;
30 ru) LANG="ru_RU" ;;
31 zh) LANG="zh_TW" ;;
32 esac
33 if echo "$po" | fgrep -q "$lang"; then
34 break
35 fi
36 done
37 unset IFS
38 export LANG LC_ALL=$LANG
40 # Internationalization: $(gettext "")
41 . /usr/bin/gettext.sh
42 TEXTDOMAIN='tazbug'
43 export TEXTDOMAIN
45 #
46 # Functions
47 #
49 # HTML 5 header.
50 html_header() {
51 cat lib/header.html
52 }
54 # HTML 5 footer.
55 html_footer() {
56 cat << EOT
57 </div>
59 <div id="footer">
60 <a href="$WEB_URL">SliTaz Bugs</a> -
61 <a href="$WEB_URL?README">README</a>
62 </div>
64 </body>
65 </html>
66 EOT
67 }
69 GETfiltered()
70 {
71 GET $1 | sed -e "s/'/\&#39;/g; s|\n|<br/>|g; s/\t/\&#09;/g;s/\%22/\"/g"
72 }
74 js_redirection_to()
75 {
76 js_log "Redirecting to $1"
77 echo "<script type=\"text/javascript\"> document.location = \"$1\"; </script>"
78 }
80 js_log()
81 {
82 echo "<script type=\"text/javascript\">console.log('$1')</script>";
83 }
85 js_set_cookie()
86 {
87 name=$1
88 value=$2
90 js_log 'Setting cookie.'
91 echo "<script type=\"text/javascript\">"
92 echo "document.cookie = \"$name=$value; expires=0; path=/\"";
93 echo "</script>"
94 }
96 js_unset_cookie()
97 {
98 name=$1
100 js_log 'Unsetting cookie.'
101 echo "<script type=\"text/javascript\">"
102 echo "document.cookie = \"$1=\"\"; expires=-1; path=/";
103 echo "</script>"
104 }
106 # Check if user is auth
107 check_auth() {
108 auth="$(COOKIE auth)"
109 user="$(echo $auth | cut -d ":" -f 1)"
110 md5cookie="$(echo $auth | cut -d ":" -f 2)"
111 [ -f "$sessions/$user" ] && md5session="$(cat $sessions/$user)"
112 if [ "$md5cookie" == "$md5session" ] && [ "$auth" ]; then
113 return 0
114 else
115 return 1
116 fi
117 }
119 # Check if user is admin
120 admin_user() {
121 fgrep -q 'ADMIN_USER="yes"' ${PEOPLE}/${user}/account.conf
122 }
124 # Authentified or not
125 user_box() {
127 IDLOC=""
128 if [[ "$(GET id)" ]] ;then
129 IDLOC="&id=$(GET id)"
130 fi
132 if check_auth; then
133 . $PEOPLE/$user/account.conf
134 cat << EOT
135 <div id="user">
136 <a href="?user=$user">$(get_gravatar $MAIL 20)</a>
137 <a href="?logout">$(gettext 'Logout')</a>
138 </div>
139 EOT
140 else
141 cat << EOT
142 <div id="user">
143 <a href="?login$IDLOC"><img src="images/avatar.png" alt="[ User ]" /></a>
144 <a href="?login$IDLOC">$(gettext 'Log in')</a>
145 </div>
146 EOT
147 fi
148 cat << EOT
150 <div id="search">
151 <form method="get" action="$WEB_URL">
152 <input type="text" name="search" placeholder="$(gettext 'Search')" />
153 <!-- <input type="submit" value="$(gettext 'Search')" /> -->
154 </form>
155 </div>
157 <!-- Content -->
158 <div id="content">
160 EOT
161 }
163 # Signup page
164 signup_page() {
165 cat << EOT
167 <div id="signup">
168 <form method="post" name="signup" action="$SCRIPT_NAME" onsubmit="return checkSignup();">
169 <input type="hidden" name="signup" value="new" />
170 <input type="text" name="name" placeholder="$(gettext "Real name")" />
171 <input type="text" name="user" placeholder="$(gettext "User name")" />
172 <input type="text" name="mail" placeholder="$(gettext "Email")" />
173 <input type="password" name="pass" placeholder="$(gettext "Password")" />
174 <div>
175 <input type="submit" value="$(gettext "Create new account")" />
176 </div>
177 </form>
178 </div>
180 EOT
181 }
183 # Link for online signup if enabled.
184 online_signup() {
185 if [ "$ONLINE_SIGNUP" == "yes" ]; then
186 echo -n "<p>" && gettext "Or:"; echo -n " "
187 echo -n "<a href='$script?signup&amp;online'>"
188 gettext "Sign Up Online"
189 echo '</a></p>'
190 fi
191 }
193 # Login page
194 login_page() {
196 IDLOC=""
197 if [[ "$(GET id)" ]] ;then
198 IDLOC="?id=$(GET id)"
199 fi
200 cat << EOT
201 <h2>$(gettext 'Login')</h2>
203 <div id="account-info">
204 <p>$(gettext "No account yet? You can signup using the SliTaz Bugs reporter \
205 on your SliTaz system.")</p>
206 $(online_signup)
207 <p>$(gettext "Tip: to attach big files or images, you can use SliTaz Paste \
208 services:") <a href="http://paste.slitaz.org/">paste.slitaz.org</a></p>
209 </div>
211 <div id="login">
212 <form method="post" action="$script">
213 <input type="text" name="auth" placeholder="$(gettext 'User name')" />
214 <input type="password" name="pass" placeholder="$(gettext 'Password')" />
215 <div>
216 <input type="submit" value="$(gettext 'Log in')" />
217 $error
218 </div>
219 </form>
220 </div>
222 <div style="clear: both;"></div>
223 EOT
224 }
226 # Display user public profile.
227 public_people() {
228 cat << EOT
229 <pre>
230 $(eval_gettext 'Real name : $NAME')
231 </pre>
232 EOT
233 }
235 # Display authentified user profile. TODO: change password
236 auth_people() {
237 cat << EOT
238 <pre>
239 $(eval_gettext 'Real name : $NAME')
240 $(eval_gettext 'Email : $MAIL')
241 $(eval_gettext 'Secure key : $KEY')
242 </pre>
243 EOT
244 }
246 # Usage: list_bugs STATUS
247 list_bugs() {
248 bug="$1"
249 echo "<h3>$(eval_gettext '$bug Bug')</h3>"
250 echo "<pre>"
251 for pr in critical standard
252 do
253 for bug in $(fgrep -H "$1" $bugdir/*/bug.conf | cut -d ":" -f 1)
254 do
255 . $bug
256 id=$(basename $(dirname $bug))
257 if [ "$PRIORITY" == "$pr" ]; then
258 [ -f "${PEOPLE}/${CREATOR}/account.conf" ] && \
259 . ${PEOPLE}/${CREATOR}/account.conf
260 cat << EOT
261 <a href="?user=$USER">$(get_gravatar "$MAIL" 24)</a> \
262 ID: $id <strong><a href="?id=$id">$BUG</a></strong> \
263 <span class="date">$DATE</span>
264 EOT
265 fi
266 unset CREATOR USER MAIL
267 done
268 done
269 }
271 # Stripped down Wiki parser for bug desc and messages which are simply
272 # displayed in <pre>
273 wiki_parser() {
274 sed \
275 -e s"#http://\([^']*\).png#<img src='\0' alt='[ Image ]' />#"g \
276 -e s"#http://\([^']*\).*# <a href='\0'>\1</a>#"g \
277 -e 's#\\\\n#\n#g;s#%22#"#g;s#%21#!#g'
278 }
280 # Bug page
281 bug_page() {
282 if [ -f "$PEOPLE/$CREATOR/account.conf" ]; then
283 . $PEOPLE/$CREATOR/account.conf
284 else
285 MAIL="default"
286 fi
287 cat << EOT
288 <h2>$(eval_gettext 'Bug $id: $STATUS')</h2>
289 <form method="get" action="$WEB_URL">
291 <p>
292 $(get_gravatar $MAIL 32) <strong>$BUG</strong>
293 </p>
294 <p>
295 $(gettext "Date:") $DATE -
296 $(eval_gettext 'Priority $PRIORITY') -
297 $(eval_ngettext '$msgs message' '$msgs messages' $msgs)
298 </p>
300 <pre>
301 $(echo "$DESC" | wiki_parser)
302 </pre>
304 <div id="tools">
305 EOT
306 if check_auth; then
307 if [ "$STATUS" == "OPEN" ]; then
308 cat << EOT
309 <a href="?id=$id&amp;close">$(gettext "Close bug")</a>
310 <a href="?edit=$id">$(gettext "Edit bug")</a>
311 EOT
312 else
313 cat << EOT
314 <a href="?id=$id&amp;open">$(gettext "Re open bug")</a>
315 EOT
316 fi
317 fi
318 cat << EOT
319 </div>
321 <h3>$(gettext "Messages")</h3>
322 EOT
323 [ "$msgs" == "0" ] && gettext "No messages"
324 for msg in $(ls -1tr $bugdir/$id/msg.*)
325 do
326 . $msg
327 if [ "$MSG" ]; then
328 msgid=$(echo $msg | cut -d "." -f 2)
329 del=""
330 # User can delete his post.
331 [ "$user" == "$USER" ] && \
332 del="<a href=\"?id=$id&amp;delmsg=$msgid\">delete</a>"
333 cat << EOT
334 <p><strong>$USER</strong> $DATE $del</p>
335 <pre>
336 $(echo "$MSG" | wiki_parser)
337 </pre>
338 EOT
339 fi
340 unset NAME DATE MSG
341 done
342 if check_auth; then
343 cat << EOT
344 <div>
345 <h3>$(gettext "New message")</h3>
347 <input type="hidden" name="id" value="$id" />
348 <textarea name="msg" rows="8"></textarea>
349 <p><input type="submit" value="$(gettext 'Send message')" /></p>
350 </form>
351 </div>
352 EOT
353 fi
354 }
356 # Write a new message
357 new_msg() {
358 date=$(date "+%Y-%m-%d %H:%M")
359 msgs=$(ls -1 $bugdir/$id/msg.* | wc -l)
360 count=$(($msgs + 1))
361 if check_auth; then
362 USER="$user"
363 fi
364 js_log "Will write message in $bugdir/$id/msg.$count "
365 sed "s/$(echo -en '\r') /\n/g" > $bugdir/$id/msg.$count << EOT
366 USER="$USER"
367 DATE="$date"
368 MSG="$(GETfiltered msg)"
369 EOT
370 }
372 # Create a new Bug
373 new_bug() {
374 count=$(ls -1 $bugdir | wc -l)
375 date=$(date "+%Y-%m-%d %H:%M")
376 # Sanity check, JS may be disabled.
377 [ ! "$(GET bug)" ] && echo "Missing bug title" && exit 1
378 [ ! "$(GET desc)" ] && echo "Missing bug description" && exit 1
379 if check_auth; then
380 USER="$user"
381 fi
382 mkdir -p $bugdir/$count
383 sed "s/$(echo -en '\r') /\n/g" > $bugdir/$count/bug.conf << EOT
384 # SliTaz Bug configuration
386 BUG="$(GETfiltered bug)"
387 STATUS="OPEN"
388 PRIORITY="$(GET priority)"
389 CREATOR="$USER"
390 DATE="$date"
391 PKGS="$(GETfiltered pkgs)"
393 DESC="$(GETfiltered desc)"
394 EOT
395 }
397 # New bug page for the web interface
398 new_bug_page() {
399 cat << EOT
400 <h2>$(gettext "New Bug")</h2>
401 <div id="newbug">
403 <form method="get" action="$WEB_URL" onsubmit="return checkNewBug();">
404 <input type="hidden" name="addbug" />
405 <table>
406 <tbody>
407 <tr>
408 <td>$(gettext "Bug title")*</td>
409 <td><input type="text" name="bug" /></td>
410 </tr>
411 <tr>
412 <td>$(gettext "Description")*</td>
413 <td><textarea name="desc"></textarea></td>
414 </tr>
415 <tr>
416 <td>$(gettext "Packages")</td>
417 <td><input type="text" name="pkgs" /></td>
418 </tr>
419 <tr>
420 <td>$(gettext "Priority")</td>
421 <td>
422 <select name="priority">
423 <option value="standard">$(gettext "Standard")</option>
424 <option value="critical">$(gettext "Critical")</option>
425 </select>
426 <input type="submit" value="$(gettext "Create Bug")" />
427 </td>
428 </tr>
429 </tbody>
430 </table>
431 </form>
433 <p>
434 $(gettext "* field is obligatory. You can also specify affected packages.")
435 </p>
437 </div>
438 EOT
439 }
442 # Edit/Save a bug configuration file
443 edit_bug() {
444 cat << EOT
445 <h2>$(eval_gettext 'Edit Bug $bug')</h2>
446 <div id="edit">
448 <form method="get" action="$WEB_URL">
449 <textarea name="bugconf">$(cat $bugdir/$bug/bug.conf)</textarea>
450 <input type="hidden" name="bug" value="$bug" />
451 <input type="submit" value="$(gettext 'Save configuration')" />
452 </form>
454 </div>
455 EOT
456 }
459 save_bug() {
460 bug="$(GET bug)"
461 content="$(GET bugconf)"
462 sed "s|\"|'|" | sed "s/$(echo -en '\r') /\n/g" > $bugdir/$bug/bug.conf << EOT
463 $content
464 EOT
465 }
468 # Close a fixed bug
469 close_bug() {
470 sed -i s'/OPEN/CLOSED/' $bugdir/$id/bug.conf
471 }
474 # Re open an old bug
475 open_bug() {
476 sed -i s'/CLOSED/OPEN/' $bugdir/$id/bug.conf
477 }
480 # Get and display Gravatar image: get_gravatar email size
481 # Link to profile: <a href="http://www.gravatar.com/$md5">...</a>
482 get_gravatar() {
483 email=$1
484 size=$2
485 [ "$size" ] || size=48
486 url="http://www.gravatar.com/avatar"
487 md5=$(md5crypt $email)
488 echo "<img src=\"$url/$md5?d=identicon&amp;s=$size\" alt=\"\" />"
489 }
491 # Create a new user in AUTH_FILE and PEOPLE
492 new_user_config() {
493 if [ ! "$online" ]; then
494 name="$(GET name)"
495 mail="$(GET mail)"
496 pass="$(GET pass)"
497 echo "Creating Server Key..."
498 fi
499 key=$(echo -n "$user:$mail:$pass" | md5sum | awk '{print $1}')
500 echo "$user:$pass" >> $AUTH_FILE
501 mkdir -pm0700 $PEOPLE/$user/
502 cat > $PEOPLE/$user/account.conf << EOT
503 # SliTaz user configuration
504 #
506 NAME="$name"
507 USER="$user"
508 MAIL="$mail"
509 KEY="$key"
511 COMMUNITY="$(GET scn)"
512 LOCATION="$(GET location)"
513 RELEASES="$(GET releases)"
514 PACKAGES="$(GET packages)"
515 EOT
516 chmod 0600 $PEOPLE/$user/account.conf
517 if [ ! -f $PEOPLE/$user/account.conf ]; then
518 echo "ERROR: User creation failed!"
519 fi
520 }
522 ########################################################################
523 # POST actions #
524 ########################################################################
526 case " $(POST) " in
527 *\ auth\ *)
528 header
529 html_header
530 # Authenticate user. Create a session file in $sessions to be used
531 # by check_auth. We have the user login name and a peer session
532 # md5 string in the COOKIE.
533 user="$(POST auth)"
534 pass="$(echo -n "$(POST pass)" | md5sum | awk '{print $1}')"
536 IDLOC=""
537 if [[ "$(GET id)" ]] ;then
538 IDLOC="&id=$(GET id)"
539 fi
541 if [ ! -f $AUTH_FILE ] ; then
542 js_log "$AUTH_FILE (defined in \$AUTH_FILE) has not been found."
543 js_redirection_to "$WEB_URL?login$IDLOC"
544 fi;
546 valid=$(fgrep "${user}:" $AUTH_FILE | cut -d ":" -f 2)
547 if [ "$pass" == "$valid" ] && [ "$pass" != "" ]; then
548 if [[ "$(GET id)" ]] ;then
549 IDLOC="?id=$(GET id)"
550 fi
551 md5session=$(echo -n "$$:$user:$pass:$$" | md5sum | awk '{print $1}')
552 mkdir -p $sessions
553 echo "$md5session" > $sessions/$user
554 js_set_cookie 'auth' "$user:$md5session"
555 js_log "Login authentification has been executed & accepted :)"
556 js_redirection_to "$WEB_URL$IDLOC"
557 else
558 js_log "Login authentification has been executed & refused"
559 js_redirection_to "$WEB_URL?login&error$IDLOC"
560 fi
561 html_footer ;;
562 *\ signup\ *)
563 # POST action for online signup
564 name="$(POST name)"
565 user="$(POST user)"
566 mail="$(POST mail)"
567 pass="$(md5crypt "$(POST pass)")"
568 if ! grep "^${user}:" $AUTH_FILE; then
569 online="yes"
570 new_user_config
571 header "Location: $SCRIPT_NAME?login"
572 else
573 header
574 html_header
575 user_box
576 echo "<h2>$(gettext "User already exists:") $user</h2>"
577 html_footer && exit 0
578 fi ;;
579 esac
581 #
582 # Plugins Now!
583 #
584 for p in $(ls -1 $plugins)
585 do
586 [ -f "$plugins/$p/$p.conf" ] && . $plugins/$p/$p.conf
587 [ -x "$plugins/$p/$p.cgi" ] && . $plugins/$p/$p.cgi
588 done
590 ########################################################################
591 # GET actions #
592 ########################################################################
594 case " $(GET) " in
595 *\ README\ *)
596 header
597 html_header
598 user_box
599 echo '<h2>README</h2>'
600 echo '<pre>'
601 cat /usr/share/doc/tazbug/README
602 echo '</pre>'
603 html_footer ;;
604 *\ closed\ *)
605 # Show all closed bugs.
606 header
607 html_header
608 user_box
609 list_bugs CLOSED
610 echo "</pre>"
611 html_footer ;;
612 *\ login\ *)
613 # The login page
614 [ "$(GET error)" ] && \
615 error="<span class='error'>$(gettext 'Bad login or pass')</span>"
616 header
617 html_header
618 user_box
619 login_page
620 html_footer ;;
621 *\ logout\ *)
622 header
623 html_header
624 if check_auth; then
625 rm -f "$sessions/$user"
626 js_unset_cookie 'auth'
627 js_redirection_to "$WEB_URL"
628 fi ;;
629 *\ user\ *)
630 # User profile
631 header
632 html_header
633 user_box
634 . $PEOPLE/"$(GET user)"/account.conf
635 echo "<h2>$(get_gravatar $MAIL) $(GET user)</h2>"
636 if check_auth && [ "$(GET user)" == "$user" ]; then
637 auth_people
638 else
639 public_people
640 fi
641 html_footer ;;
642 *\ newbug\ *)
643 # Add a bug from web interface.
644 header
645 html_header
646 user_box
647 if check_auth; then
648 new_bug_page
649 else
650 echo "<p>$(gettext 'You must be logged in to post a new bug')</p>"
651 fi
652 html_footer ;;
653 *\ addbug\ *)
654 # Add a bug from web interface.
655 header
656 html_header
657 if check_auth; then
658 new_bug
659 js_redirection_to "$WEB_URL?id=$count"
660 fi ;;
661 *\ edit\ *)
662 bug="$(GET edit)"
663 header
664 html_header
665 user_box
666 edit_bug
667 html_footer ;;
668 *\ bugconf\ *)
669 header
670 html_header
671 if check_auth; then
672 save_bug
673 js_redirection_to "$WEB_URL?id=$bug"
674 fi ;;
675 *\ id\ *)
676 # Empty deleted messages to keep msg count working.
677 header
678 html_header
679 id="$(GET id)"
680 [ "$(GET close)" ] && close_bug
681 [ "$(GET open)" ] && open_bug
682 [ "$(GET msg)" ] && new_msg
683 [ "$(GET delmsg)" ] && rm -f $bugdir/$id/msg.$(GET delmsg) && \
684 touch $bugdir/$id/msg.$(GET delmsg)
685 msgs=$(fgrep MSG= $bugdir/$id/msg.* | wc -l)
686 user_box
687 . $bugdir/$id/bug.conf
688 bug_page
689 html_footer ;;
690 *\ signup\ *)
691 # Signup
692 if [ "$(GET online)" ];then
693 header
694 html_header
695 user_box
696 echo "<h2>$(gettext "Sign Up")</h2>"
697 if [ "$ONLINE_SIGNUP" == "yes" ]; then
698 signup_page
699 else
700 gettext "Online registration is disabled"
701 fi
702 html_footer && exit 0
703 else
704 header "Content-type: text/plain;"
705 user="$(GET signup)"
706 echo "Requested user login : $user"
707 if fgrep -q "$user:" $AUTH_FILE; then
708 echo "ERROR: User already exists" && exit 1
709 else
710 echo "Creating account for : $(GET name)"
711 new_user_config
712 fi
713 fi ;;
714 *\ key\ *)
715 # Let user post new bug or message with crypted key (no gettext)
716 #
717 # Testing only and is security acceptable ?
718 #
719 key="$(GET key)"
720 id="$(GET bug)"
721 header "Content-type: text/plain;"
722 echo "Checking secure key..."
723 if fgrep -qH $key $PEOPLE/*/account.conf; then
724 conf=$(fgrep -H $key $PEOPLE/*/account.conf | cut -d ":" -f 1)
725 . $conf
726 echo "Authentified: $NAME ($USER)"
727 case " $(GET) " in
728 *\ msg\ *)
729 [ ! "$id" ] && echo "Missing bug ID" && exit 0
730 echo "Posting new message to bug: $id"
731 echo "Message: $(GET msg)"
732 new_msg ;;
733 *\ bug\ *)
734 echo "Adding new bug: $(GET bug)"
735 echo "Description: $(GET desc)"
736 new_bug ;;
737 esac
738 else
739 echo "Not a valid SliTaz user key"
740 exit 0
741 fi ;;
742 *\ search\ *)
743 header
744 html_header
745 user_box
746 cat << EOT
747 <h2>$(gettext "Search")</h2>
748 <form method="get" action="$WEB_URL">
749 <input type="text" name="search" />
750 <input type="submit" value="$(gettext 'Search')" />
751 </form>
752 <div>
753 EOT
755 #found=0 JS to notify or write results nb under the search box.
756 for bug in $bugdir/*
757 do
758 result=$(fgrep -i "$(GET search)" $bug/*)
759 if [ "$result" ]; then
760 #found=$(($found + 1))
761 id=${bug#bug/}
762 echo "<p><strong>Bug $id</strong> <a href=\"?id=$id\">"$(gettext 'Show')"</a></p>"
763 echo '<pre>'
764 fgrep -i "$(GET search)" $bugdir/$id/* | \
765 sed s"/$(GET search)/<span class='ok'>$(GET search)<\/span>/"g
766 echo '</pre>'
767 else
768 get_search=$(GET search)
769 echo "<p>$(eval_gettext 'No result found for: $get_search')</p>"
770 fi
771 done
772 echo '</div>'
773 html_footer ;;
774 *)
775 # Default page.
776 bugs=$(ls -1 $bugdir | wc -l)
777 close=$(fgrep "CLOSED" $bugdir/*/bug.conf | wc -l)
778 fixme=$(fgrep "OPEN" $bugdir/*/bug.conf | wc -l)
779 msgs=$(find $bugdir -name msg.* ! -size 0 | wc -l)
780 pct=0
781 [ $bugs -gt 0 ] && pct=$(( ($close * 100) / $bugs ))
782 header
783 html_header
784 user_box
785 cat << EOT
787 <h2>$(gettext "Summary")</h2>
789 <p>
790 $(eval_ngettext 'Bug: $bugs in total -' 'Bugs: $bugs in total -' $bugs)
791 $(eval_ngettext '$close fixed -' '$close fixed -' $close)
792 $(eval_ngettext '$fixme to fix -' '$fixme to fix -' $fixme)
793 $(eval_ngettext '$msgs message' '$msgs messages' $msgs)
794 </p>
796 <div class="pctbar">
797 <div class="pct" style="width: ${pct}%;">${pct}%</div>
798 </div>
800 <p>$(gettext "Please read the <a href=\"?README\">README</a> for help and \
801 more information. You may also be interested by the SliTaz \
802 <a href=\"http://roadmap.slitaz.org/\">Roadmap</a> and the packages \
803 <a href=\"http://cook.slitaz.org/\">Cooker</a>. To perform a search \
804 enter your term and press ENTER.")
805 </p>
807 <div id="tools">
808 <a href="?closed">$(gettext 'View closed bugs')</a>
809 EOT
810 if check_auth; then
811 echo "<a href='?newbug'>$(gettext 'Create a new bug')</a>"
812 echo "$PLUGINS_TOOLS"
813 fi
814 cat << EOT
815 </div>
816 EOT
817 list_bugs OPEN
818 echo "</pre>"
819 html_footer ;;
820 esac
822 exit 0