# HG changeset patch # User Christophe Lincoln # Date 1487811043 -3600 # Node ID 7367332b16fcbe2edad43e9191d700db3b9cff37 # Parent 3e8cfa56fb9c1e10797f6cc2153b0fca190f1cee scn: use mybug user.sh script for user profile diff -r 3e8cfa56fb9c -r 7367332b16fc scn/images/bug.png Binary file scn/images/bug.png has changed diff -r 3e8cfa56fb9c -r 7367332b16fc scn/images/fb.png Binary file scn/images/fb.png has changed diff -r 3e8cfa56fb9c -r 7367332b16fc scn/images/logo.png Binary file scn/images/logo.png has changed diff -r 3e8cfa56fb9c -r 7367332b16fc scn/images/twitter.png Binary file scn/images/twitter.png has changed diff -r 3e8cfa56fb9c -r 7367332b16fc scn/plugins/mybugs/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scn/plugins/mybugs/README Thu Feb 23 01:50:43 2017 +0100 @@ -0,0 +1,7 @@ +mybugs - TinyCM/SCN plugin +-------------------------------------------------------------------------------- + +user.sh is sourced in users profile page. The original script is in the +tazbug Hg repository: web/plugins/mybugs + +bugdir.conf: set path to bug database. On Tank: /home/slitaz/www/bugs/bug diff -r 3e8cfa56fb9c -r 7367332b16fc scn/plugins/mybugs/bugdir.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scn/plugins/mybugs/bugdir.conf Thu Feb 23 01:50:43 2017 +0100 @@ -0,0 +1,1 @@ +bugdir="/home/pankso/Public/cgi-bin/tazbug/web/bug" diff -r 3e8cfa56fb9c -r 7367332b16fc scn/plugins/mybugs/user.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scn/plugins/mybugs/user.sh Thu Feb 23 01:50:43 2017 +0100 @@ -0,0 +1,58 @@ +#!/bin/sh +# +# This script display bug for a given user. A copy is used on SCN to +# display user bugs on profile page with a custom config file to set +# $bugdir. +# +[ -f "$plugins/mybugs/bugdir.conf" ] && . $plugins/mybugs/bugdir.conf +[ "$(GET user)" ] && user="$(GET user)" +url="http://bugs.slitaz.org/" + +if fgrep -q -l "CREATOR=\"$user\"" ${bugdir}/*/*/bug.conf; then + show_more="0" + echo "

Latest bugs

" + echo "
"
+	for bug in $(fgrep -l "CREATOR=\"$user\"" ${bugdir}/*/*/bug.conf | \
+		xargs ls -lt | awk '{print $9}' | head -n 4)
+	do
+		. ${bug}
+		id=$(basename $(dirname $bug))
+		cat << EOT
+ \
+Bug $id: $BUG - $DATE
+EOT
+	done
+	echo "
" +fi + +if fgrep -q -l "USER=\"$user\"" ${bugdir}/*/*/msg.*; then + show_more="0" + echo "

Latest debug messages

" + echo "
"
+	
+	for msg in $(fgrep -l "USER=\"$user\"" ${bugdir}/*/*/msg.* | \
+		xargs ls -lt | awk '{print $9}' | head -n 4)
+	do
+		. ${msg}
+		id=$(basename $(dirname $msg))
+		msgid=$(echo $msg | cut -d "." -f 2)
+		message="$(fgrep MSG= $msg | cut -d \" -f 2 | cut -c 1-40)"
+		cat << EOT
+ \
+Bug $id: $DATE \
+${message}...
+EOT
+	done
+	echo "
" +fi + +if [ "$show_more" ]; then + echo "

" + if [ "$HTTP_HOST" == "bugs.slitaz.org" ]; then + echo "$(gettext 'View all my bugs and messages')" + else + echo "$(gettext 'View all my bugs and debug messages on:') " + echo "bugs.slitaz.org" + fi + echo "

" +fi diff -r 3e8cfa56fb9c -r 7367332b16fc scn/style.css --- a/scn/style.css Tue Feb 21 17:03:12 2017 +0100 +++ b/scn/style.css Thu Feb 23 01:50:43 2017 +0100 @@ -6,6 +6,7 @@ h1 a { color: #fff; text-decoration: none; } h2 { color: #444; } h3 { color: #666; font-size: 140%; } a { text-decoration: underline; color: #215090; } +pre a { text-decoration: none; } a:hover { text-decoration: none; } img { border: 0pt none; vertical-align: middle; } pre { diff -r 3e8cfa56fb9c -r 7367332b16fc tank/tank --- a/tank/tank Tue Feb 21 17:03:12 2017 +0100 +++ b/tank/tank Thu Feb 23 01:50:43 2017 +0100 @@ -152,6 +152,7 @@ cd $REPOS/slitaz-forge && hg pull -u cp -f scn/style* $WWW/scn cp -f scn/header.html $WWW/scn/lib + rm -rf $WWW/scn/images && cp -a scn/images $WWW/scn cp -a scn/plugins $WWW/scn # Use TinyCM cmdline tool cd $REPOS/tinycm && hg pull -u