tazbug view web/bugs.cgi @ rev 53

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