# HG changeset patch # User Christophe Lincoln # Date 1332627164 -3600 # Node ID 8b324cb2c5e20e3787be493ae6e38ca6770e410b # Parent 28218999e1ce677ee9ba2929daf89e0696ed45a9 Add the web interface diff -r 28218999e1ce -r 8b324cb2c5e2 web/db.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/db.conf Sat Mar 24 23:12:44 2012 +0100 @@ -0,0 +1,13 @@ +# Pizza web interface DB files. + +chroot="$PIZZA/chroot" +pkgs="${chroot}$SLITAZ/packages" +cache="${chroot}$SLITAZ/cache" +queue="${chroot}$SLITAZ/queue" +tmpdir="${chroot}$SLITAZ/tmp" +public="$VHOST/public" +activity="$cache/activity" +builds="$cache/builds" + +#htmldoc="/usr/share/doc/pizza" +htmldoc="/home/slitaz/pizza/doc" diff -r 28218999e1ce -r 8b324cb2c5e2 web/favicon.ico Binary file web/favicon.ico has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/images/archive.png Binary file web/images/archive.png has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/images/down.png Binary file web/images/down.png has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/images/download.png Binary file web/images/download.png has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/images/info.png Binary file web/images/info.png has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/images/iso.png Binary file web/images/iso.png has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/images/logo.png Binary file web/images/logo.png has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/images/monitor.png Binary file web/images/monitor.png has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/images/paypal.png Binary file web/images/paypal.png has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/images/tazpkg.png Binary file web/images/tazpkg.png has changed diff -r 28218999e1ce -r 8b324cb2c5e2 web/lib/footer.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/footer.html Sat Mar 24 23:12:44 2012 +0100 @@ -0,0 +1,9 @@ + + + + + + + diff -r 28218999e1ce -r 8b324cb2c5e2 web/lib/functions.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/functions.js Sat Mar 24 23:12:44 2012 +0100 @@ -0,0 +1,47 @@ +// SliTaz Pizza Javascript functions. +// + +// Check form to avoid empty values and bad email. +function checkForm() { + if(document.forms["pizza"]["flavor"].value == "") + { + alert("Please enter SliTaz pizza flavor name"); + document.forms["pizza"]["flavor"].focus(); + return false; + } + if(document.forms["pizza"]["desc"].value == "") + { + alert("Please fill up the flavor description"); + document.forms["pizza"]["desc"].focus(); + return false; + } + var x=document.forms["pizza"]["mail"].value; + var atpos=x.indexOf("@"); + var dotpos=x.lastIndexOf("."); + if (atpos<1 || dotpos=x.length) + { + alert("Missing or not a valid email address"); + return false; + } +} + +// Notification messages +function setOpacity(notifyId, opacityLevel) { + var notifyStyle = document.getElementById(notifyId).style; + notifyStyle.opacity = opacityLevel / 100; + notifyStyle.filter = 'alpha(opacity='+opacityLevel+')'; +} + +function fadeNotify(notifyId, startOpacity, stopOpacity, duration) { + var speed = Math.round(duration / 100); + var timer = 2000; + for (var i=startOpacity; i>=stopOpacity; i--) { + setTimeout("setOpacity('"+notifyId+"',"+i+")", timer * speed); + timer++; + } +} + +function hideNotify() { + document.getElementById('notify').style.display = 'none'; +} + diff -r 28218999e1ce -r 8b324cb2c5e2 web/lib/header.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/header.html Sat Mar 24 23:12:44 2012 +0100 @@ -0,0 +1,25 @@ + + + + + SliTaz Pizza + + + + + + + + +
diff -r 28218999e1ce -r 8b324cb2c5e2 web/lib/libpizza --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/libpizza Sat Mar 24 23:12:44 2012 +0100 @@ -0,0 +1,57 @@ +#!/bin/sh +# +# Common functions for Pizza CGI/SHell web interface. +# + +[ -f "/etc/slitaz/pizza.conf" ] && . /etc/slitaz/pizza.conf +[ -f "../pizza.conf" ] && . ../pizza.conf +. ./db.conf +. /usr/lib/slitaz/httphelper +header + +# xHTML header. +cat lib/header.html || exit 1 + +# Status function. +status() { + if [ $? = 0 ]; then + echo " OK" + else + echo " Failed" + fi +} + +# Put some colors in log and DB files. +highlighter() { + case $1 in + log) + sed -e 's#OK#OK#g' \ + -e 's#Failed#Failed#g' ;; + activity) + sed s"#^\([^']* : \)#\0#"g ;; + esac +} + +# Log activities, we want first letter capitalized. +log() { + grep ^[A-Z] | \ + sed s"#^[A-Z]\([^']*\)#$(date '+%Y-%m-%d %H:%M') : \0#" >> $activity +} + +# Usage: error string +error() { + echo "ERROR: $@" +} + +# Pizza notification function: notify "message" "icon" +notify() { + img=info + [ "$2" ] && img=$2 + cat << EOT + +EOT +} diff -r 28218999e1ce -r 8b324cb2c5e2 web/pizza.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/pizza.cgi Sat Mar 24 23:12:44 2012 +0100 @@ -0,0 +1,369 @@ +#!/bin/sh +# +# SliTaz Pizza CGI/web interface - Let's me have a pizza :-) +# Please KISS, it is important and keep speed in mind. Thanks, Pankso. +# + +# Output a RSS feed of latest build isos. +if [ "$QUERY_STRING" == "rss" ]; then + . /etc/slitaz/pizza.conf + pubdate=$(date "+%a, %d %b %Y %X") + cat << EOT +Content-Type: text/xml + + + + + SliTaz Pizza + The SliTaz Pizza cooker feed + $PIZZA_URL + $pubdate GMT + $pubdate GMT +EOT + for rss in $(ls -1t $PIZZA/chroot${SLITAZ}/xml/*.xml | head -n 12) + do + cat $rss + done + cat << EOT + + +EOT + exit 0 +fi + +# Content negotiation for Gettext +IFS="," +for lang in $HTTP_ACCEPT_LANGUAGE +do + lang=${lang%;*} lang=${lang# } lang=${lang%-*} + [ -d "$lang" ] && break + case "$lang" in + en) lang="C" ;; + fr) lang="fr_FR" ;; + esac +done +unset IFS +export LANG=$lang LC_ALL=$lang + +# Internationalization: $(gettext "") +. /usr/bin/gettext.sh +TEXTDOMAIN='pizza' +export TEXTDOMAIN + +. lib/libpizza + +# +# Commands +# + +case " $(GET) " in + *\ start\ *) + # + # First step + # + date=$(date "+%Y%m%d") + id=$date-$$ + cat << EOT +

$(gettext "First step")

+

+ $(gettext "Chosse your distribution name and the one you want to use as + base. We need our mail to notify you when your SliTaz Flavor is built + and if any things goes wrong.") +

+
+ + + + + + + + + + + + + + + + + + + +
$(gettext "Flavor name")
$(gettext "Short description")
$(gettext "Email")
$(gettext "Based on") + +
+
+Uniq ID : $id
+
+ +
+EOT + ;; + *\ gen\ *) + # + # Generate step + # + id="$(GET id)" + . $tmpdir/slitaz-$id/receipt + addfiles=$(find $tmpdir/slitaz-$id/addfiles -type f | wc -l) + [ "$addfiles" ] || addfiles=0 + packages=$(cat $tmpdir/slitaz-$id/packages.list | wc -l) + cat << EOT +

$(gettext "Generate")

+

+ Last chance to stop process or start over. Next step will pack your + flavor and add it to the build queue. Here you can also add note to + your receipt flavor, this will be displayed on your flavor ID page + and can be used to give more infos to other users and SliTaz developers. +

+
+Uniq ID    : $id
+Flavor     : $FLAVOR
+Short desc : $SHORT_DESC
+Maintainer : $MAINTAINER
+Packages   : $packages
+Addfiles   : $addfiles
+
+
+
+ Note: + +
+ +
+EOT + ;; + *\ cancel\ *) + id="$(GET id)" + echo "

Removing temporary files for: $id

" + [ -d "$tmpdir/slitaz-$id" ] && rm -rf $tmpdir/slitaz-$id/ + cat << EOT +
+ +
+EOT + ;; + *\ pack\ *) + # + # Pack distro step + # + id="$(GET id)" + receipt="$tmpdir/slitaz-$id/receipt" + addfiles="$(GET addfiles)" + log="$tmpdir/slitaz-$id/distro.log" + note="$(GET note)" + inqueue=$(ls $queue | wc -l) + . $receipt + cat << EOT +

$(gettext "Packing:") $FLAVOR

+
+EOT
+		if ! fgrep ADDFILES $receipt; then
+			echo "ADDFILES=\"$addfiles\"" >> $receipt
+		fi
+		if ! fgrep NOTE $receipt; then
+			echo "NOTE=\"$note\"" >> $receipt
+		fi
+		
+		# The rootcd README
+		echo -n "Creating SliTaz cdrom README..."
+		date=$(date '+%Y-%m-%d %H:%M')
+		mkdir -p $tmpdir/slitaz-$id/rootcd
+		cp $DATA/README.distro $tmpdir/slitaz-$id/rootcd/README
+		sed -i s"/_DATE_/$date/" $tmpdir/slitaz-$id/rootcd/README
+		status
+		
+		echo -n "Creating flavor tarball..."
+		cd $tmpdir && tar cjf $FLAVOR.tar.bz2 slitaz-$id
+		mkdir -p $public/slitaz-$id
+		mv $FLAVOR.tar.bz2 $public/slitaz-$id
+		status
+		
+		# Keep a public receipt copy and move everything from tmp to queue.
+		echo "Flavor packed   : $(date '+%Y-%m-%d %H:%M')" | tee -a $log
+		echo -n "Moving $id to Pizza build queue..."
+		mv -f $tmpdir/slitaz-$id/distro.log $public/slitaz-$id
+		cp -f $tmpdir/slitaz-$id/receipt $public/slitaz-$id
+		mv $tmpdir/slitaz-$id $queue
+		status
+		
+		if [ "$inqueue" == "1" ]; then
+			gettext "Your ISO will be built on next Pizza Bot run"
+		else
+			eval_gettext "Ther is \$inqueue flavors in queue"
+		fi
+		echo ""
+		echo "New flavor added to queue: $id" | log
+		cat << EOT
+
+
+ [ tarball ] + $(gettext "Download tarball: ") + $FLAVOR.tar.bz2 + - Browse the flavor +
+ +EOT + ;; + *\ id\ *) + # + # ID Status page + # + id="$(GET id)" + [ -f "$queue/slitaz-$id/receipt" ] && . $queue/slitaz-$id/receipt + [ -f "public/slitaz-$id/receipt" ] && . public/slitaz-$id/receipt + log="$public/slitaz-$id/distro.log" + if [ ! -d "public/slitaz-$id" ]; then + echo "Sorry, can't found flavor ID: $id" + cat lib/footer.html && exit 0 + fi + if [ -f "$public/slitaz-$id/$FLAVOR.iso" ]; then + dir="public/slitaz-$id" + list="$dir/packages.list" + iso="$dir/$FLAVOR.iso" + msg="$(gettext "Download ISO:") $FLAVOR.iso + [ md5 ]" + else + list="$queue/slitaz-$id/packages.list" + msg="$(gettext "Flavor is building or still in the build queue")" + fi + pkgslist=$(cat $list | wc -l) + pkgsinst=$(cat $installed | wc -l) + [ "$pkgsinst" ] || pkgsinst=0 + [ "$ISO_SIZE" ] || ISO_SIZE="N/A" + [ "$ROOTFS_SIZE" ] || ROOTFS_SIZE="N/A" + cat << EOT +

$(gettext "Status for:") $FLAVOR

+

+ $(gettext "Flavor description:") $SHORT_DESC +

+
+Uniq ID     : $id
+Flavor      : $FLAVOR
+Packages    : $pkgslist in list - $pkgsinst installed
+Rootfs size : $ROOTFS_SIZE
+ISO size    : $ISO_SIZE
+
+ +
+ [ iso ] $(echo $msg) +
+
+ [ tarball ] + $(gettext "Download tarball:") + $FLAVOR.tar.bz2 +EOT + if [ -f "$public/slitaz-$id/$FLAVOR.flavor" ]; then + cat << EOT + - Flavor file: $FLAVOR.flavor +EOT + fi + cat << EOT + - Browse the flavor +
+EOT + if [ "$NOTE" ]; then + echo "
$NOTE
" + fi + if [ -f "$log" ]; then + echo '

Distro log

' + echo '
'
+			fgrep 'Build time' $log
+			cat $log | highlighter log
+			echo '
' + fi ;; + *\ help\ *) + echo "

$(gettext "Help")

" + echo "TODO: HTML faq/doc" + echo '
'
+		cat /usr/share/doc/pizza/README
+		echo '
' ;; + *\ info\ *) + # English only :-) + if mount | fgrep -q slitaz/public; then + mounted="Public is mounted" + else + mounted="WARRNING: Public is not mounted" + fi + echo '

Pizza Info

' + echo '
'
+		[ "$mounted" ] && echo "$mounted"
+		echo -n "Public flavors : " && ls -1 public | wc -l
+		echo -n "Public size    : " && du -sh public | awk '{print $1}'
+		echo -n "Tmp size       : " && du -sh $tmpdir | awk '{print $1}'
+		echo '
' ;; + *) + # + # Main page + # + inqueue=$(ls $queue | wc -l) + builds=$(cat $builds) + pubiso=$(ls -1 public | wc -l) + [ "$builds" ] || builds=0 + cat << EOT +

$(gettext "Welcome")

+

+ SliTaz Pizza let you create your own SliTaz ISO flavor online. The + ISO image can be burnt on a cdrom or installed on an USB media. + Please read the SliTaz Pizza + Help before starting a new flavor. +

+
+Flavors: $inqueue in queue - $builds builds - $pubiso public
+
+ +
+
+ + +
+
+ +

Activity

+
+$(tac $activity | head -n 12 | highlighter activity)
+
+ +EOT + echo "

$(gettext "Latest builds")

" + echo '
'
+		for flavor in $(ls -1t public | head -n 12)
+		do
+			if [ -f "public/$flavor/receipt" ]; then
+				. ./public/$flavor/receipt
+				[ -f "public/$flavor/$FLAVOR.iso" ] && \
+					cat << EOT
+$VERSION : $FLAVOR.iso ($ISO_SIZE)
+EOT
+			fi
+		done 
+		echo '
' ;; +esac + +# HTML footer. +cat lib/footer.html + +exit 0 diff -r 28218999e1ce -r 8b324cb2c5e2 web/pkgs.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/pkgs.cgi Sat Mar 24 23:12:44 2012 +0100 @@ -0,0 +1,142 @@ +#!/bin/sh +# +# SliTaz Pizza CGI/web interface - Let's me have a pizza :-) +# Packages step +# + +. lib/libpizza + +id="$(GET id)" +flavor="$(GET flavor)" +skel="$(GET skel)" +desc="$(GET desc)" +mail="$(GET mail)" +add="$(GET add)" +log="$tmpdir/slitaz-$id/distro.log" +list="$tmpdir/slitaz-$id/packages.list" + +# +# Functions +# + +list_pkgs() { + # Pizza use local packages synced with mirror each night. + pkgsdesc="$SLITAZ/$SLITAZ_VERSION/packages/packages.desc" + [ ! -f "$pkgsdesc" ] && echo "Missing: $pkgsdesc" + for pkg in $(cat $list) + do + IFS="|" + grep "^$pkg |" $pkgsdesc | cut -f 1,2,3 -d "|" | \ + while read PACKAGE VERSION SHORT_DESC + do + cat << EOT + + + $PACKAGE + $VERSION + $SHORT_DESC + +EOT + done + done +} + +# Gen an empty receipt for new flavor. +empty_receipt() { + cat > $tmpdir/slitaz-$id/receipt << EOT +# SliTaz flavor receipt. + +FLAVOR="" +SHORT_DESC="" +VERSION="$(date "+%Y%m%d")" +MAINTAINER="" + +ID="" +SKEL="" + +EOT +} + +# +# Actions +# + +case " $(GET) " in + *\ add\ *) + for pkg in $add + do + if ! grep -q ^${pkg}$ $list; then + echo "$pkg" >> $list + fi + done ;; + *\ rm\ *) + cmdline=$(echo ${QUERY_STRING#pkg=} | sed s'/&/ /g') + cmdline=${cmdline%id=*} + pkgs=$(echo $cmdline | sed -e s'/+/ /g' -e s'/pkg=//g' -e s/$cmd//) + for pkg in $pkgs + do + sed -i "/^${pkg}$/"d $list + done ;; + *) + # No space in flavor name please. + flavor=$(echo $flavor | sed s'/ //'g) + # Javascript can be disable in browser. + [ ! "$flavor" ] && echo "Missing flavor name" && exit 0 + [ ! "$mail" ] && echo "Missing email address" && exit 0 + [ ! "$skel" ] && echo "Missing SliTaz skeleton" && exit 0 + [ ! "$desc" ] && echo "Missing short desciption" && exit 0 + mkdir -p $tmpdir/slitaz-$id + cp -f $cache/packages.$skel $list + echo "Receipt created : $(date '+%Y-%m-%d %H:%M')" > $log + empty_receipt + sed -i \ + -e s"/FLAVOR=.*/FLAVOR=\"slitaz-$flavor\"/" \ + -e s"/MAINTAINER=.*/MAINTAINER=\"$mail\"/" \ + -e s"/SKEL=.*/SKEL=\"$skel\"/" \ + -e s"/SHORT_DESC=.*/SHORT_DESC=\"$desc\"/" \ + -e s"/ID=.*/ID=\"$id\"/" $tmpdir/slitaz-$id/receipt ;; +esac + +# +# Source the receipt and display page. +# +. $tmpdir/slitaz-$id/receipt + +nb=$(cat $list | wc -l) +cat << EOT +

Packages ($nb)

+ +
+ + + $(list_pkgs) + +
+
+ + + + +
+ + + +
+ +
+Uniq ID    : $id
+Flavor     : $FLAVOR
+Short desc : $SHORT_DESC
+
+ +EOT + +# HTML footer. +cat lib/footer.html + +exit 0 diff -r 28218999e1ce -r 8b324cb2c5e2 web/rootfs.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/rootfs.cgi Sat Mar 24 23:12:44 2012 +0100 @@ -0,0 +1,151 @@ +#!/bin/sh +# +# SliTaz Pizza CGI/web interface - Let's me have a pizza :-) +# SliTaz rootfs step +# + +. lib/libpizza +log="$tmpdir/slitaz-$id/distro.log" + +# Internationalization: $(gettext "") +. /usr/bin/gettext.sh +TEXTDOMAIN='pizza' +export TEXTDOMAIN + +# Handle rootfs.* file upload. +tarball_handler() { + echo "
"
+	echo "File name : $tarball"
+	echo "File size : $size Bytes"
+	gettext "Moving rootfs tarball to slitaz-$id"
+	upload=$tmpdir/slitaz-$id/upload-$$
+	mkdir -p $upload && cd $upload
+	mv $tmpname "$upload/$tarball" && rm -rf $(dirname $tmpname)
+	chmod a+r $upload/$tarball
+	status
+	
+	# Ectract into the tmp upload dir.
+	gettext "Extracting archive for sanity checks..."
+	case "$tarball" in
+		*.tar.gz) tar xzf $tarball && status ;;
+		*.tar.bz2) tar xjf $tarball && status ;;
+		*.tar.lzma) tar xaf $tarball && status ;;
+		*) echo && error "Unsupported tarball format" && rm -rf $upload
+	esac
+	
+	# Upload dir is removed if bad tarball so we stop here. Now be a bit
+	# restrictive using only rootfs as archive name and check FSH in root.
+	# Dont allow files in /dev /proc /sys /tmp /mnt
+	if [ -d "$upload/rootfs" ]; then
+		gettext "Checking Filesystem Standard..."
+		for i in $(ls $upload/rootfs)
+		do
+			case "$i" in
+				bin|boot|etc|home|init|lib|root|sbin|usr|var) continue ;;
+				*) echo "Bad FSH path for: $i" && rm -rf $upload ;;
+			esac
+		done && status
+		# Dont allow too big rootfs content.
+		size=$(du -s $upload/rootfs | awk '{print $1}')
+		gettext "Checking uploaded rootfs size..."
+		if [ "$size" -lt "$MAX_UPLOAD" ]; then
+			status
+		else
+			echo && error "Tarball is too big"
+			rm -rf $upload
+		fi
+	fi
+	
+	# So now it time to move the addfile to flavor files.
+	if [ -d "$upload/rootfs" ]; then
+		echo "Additionnal rootfs: accepted" | tee -a $log
+		mkdir -p $tmpdir/slitaz-$id
+		mv $upload/rootfs $tmpdir/slitaz-$id
+		rm -rf $tmpdir/slitaz-$id/upload-*
+	fi
+	echo "
" + rm -rf $upload +} + +# +# Actions +# + +case " $(FILE) " in + *\ wallpaper\ *) + id="$(POST id)" + tmpname="$(FILE wallpaper tmpname)" + wallpaper="$(FILE wallpaper name)" + size="$(FILE wallpaper size)" + if echo $wallpaper | fgrep -q .jpg; then + images=$tmpdir/slitaz-$id/rootfs/usr/share/images + mkdir -p $images + mv $tmpname $images/slitaz-background.jpg + chmod a+r $images/*.jpg + notify "$(gettext "Added image:") $wallpaper ($size Bytes)" "info" + else + notify "$(gettext "Unsupported image format")" "error" + fi ;; + *\ tarball\ *) + id="$(POST id)" + tmpname="$(FILE tarball tmpname)" + tarball="$(FILE tarball name)" + size="$(FILE tarball size)" ;; + *) + id="$(GET id)" ;; +esac + +# +# Source receipt and display page with additonal rootfs or file upload. +# +. $tmpdir/slitaz-$id/receipt +cat << EOT +

Rootfs

+
+ +

+ SliTaz root filesystem modification can be done via an easy to use form, + a single tarball or by uploading file one by one in the wanted directory. +

+ +

$(gettext "Easy customization")

+ + $(gettext "Desktop Wallpaper"): + + + +

$(gettext "Rootfs tarball")

+

+ The files in the rootfs archive must have the same directory structure + than any standard SliTaz or Linux system. For example if you wish to + have a custom boot configuration file, you will have: rootfs/etc/rcS.conf. + Accepted tarball format are: tar.gz tar.bz2 tar.lzma + and the archived directory must be named rootfs with a valid file system + hierachy such as: /usr/bin /etc /var/www +

+ + Rootfs tarball: + + + +
+ +$([ "$tarball" ] && tarball_handler) + +
+Uniq ID    : $id
+Flavor     : $FLAVOR
+Short desc : $SHORT_DESC
+
+ +EOT + +# HTML footer. +cat lib/footer.html + +exit 0 diff -r 28218999e1ce -r 8b324cb2c5e2 web/style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/style.css Sat Mar 24 23:12:44 2012 +0100 @@ -0,0 +1,182 @@ +/* CSS style for SliTaz Pizza */ + +html { height: 102%; } +body { font: 13px sans-serif, vernada, arial; margin: 0; } +h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; } +h1 a { color: #fff; text-decoration: none; } +h2 { color: #444; } h3 { color: #666; font-size: 130%; } +a { text-decoration: underline; color: #215090; } +a:hover { text-decoration: none; } +img { vertical-align: middle; } +h2 img { padding: 0px 6px 6px 0px; } + +pre { + background-color: #f8f8f8; + border: 1px solid #ddd; + padding: 10px; + overflow: auto; + font-size: 98%; +} +table { + background-color: #f8f8f8; + border: 1px solid #ddd; + width: 100%; + margin: 0px 0px 20px 0px; + padding: 10px; +} +/* HTML 5 dont allow size="40" but it's buggy on FF + * input[type="file"] { width: 240px; margin: 0 5px; } */ + +/* Header */ + +#header { + background: #351a0a; + height: 40px; + border-bottom: 8px solid #ffad02; + /*border-bottom: 8px solid #d66018;*/ +} + +#header h1 { + margin: 0; + padding: 8px 0 0 42px; + width: 250px; +} + +#header h1 a { + color: white; + text-decoration: none; + font-size: 20px; + font-style: italic; +} + +#header h1 a:hover, #network a:hover { + color: #d66018; +} + +/* Logo */ + +#logo { + background: url(images/logo.png) no-repeat left; + position: absolute; + float: left; + left: 0px; + top: 0px; + width: 40px; + height: 40px; +} + +/* Header links */ + +#network { + float: right; + padding: 12px 5px 0; + font-size: 12px; +} + +#network a { + padding: 0 6px; + color: #fff; + font-weight: bold; + text-decoration: none; +} + +/* Notification box */ + +#notify { + /*font-weight: bold;*/ + background-color: #351a0a; + border: 1px solid #ffad02; + color: #fff; + cursor: help; + position: absolute; + top: 58px; + right: 10px; + width: auto; + padding: 6px 12px; +} +#notify img { margin-right: 10px; } + +/* Content */ + +#content { + margin: 40px auto; + text-align: justify; + width: 780px; +} + +.note { + margin: 20px; + padding: 20px; + background-color: #eaeaea; + border: 2px solid #ccc; +} + +.box { margin: 20px 0; } +.next { float: right; } + +.span-ok { color: green; } +.span-red { color: red; } +.log-date { color: #666; font-size: 95%; } + +/* Form */ + +form { display: inline; } +input[type="submit"], input[type="text"], textarea, select { + color: #444444; + border: 1px solid #cccccc; + padding: 4px; + margin: 4px 0px; + font-size: 14px; + line-height: 1.2em; + background-image: -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); + background-image: -moz-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); + -webkit-appearance: none; + -webkit-padding-end: 12px; + -webkit-padding-start: 6px; +} + +input[type="text"] { background: #fefefe; border: 2px solid #ccc; + width: 460px; } +/*input[type="file"] { border: 2px solid #ddd; }*/ +/*input[type="checkbox"] { background: #fefefe; }*/ + +/* Be compatible with old FF and Webkit version. */ +input[type="submit"] { + -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); +} + +input[type="submit"]:hover { + cursor: pointer; + color: black; +} + +select { + background-image: url(images/down.png), + -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); + background-position: center right; + background-repeat: no-repeat; +} + +/* Round corner */ + +pre, table, input, textarea, select, .note, .box, #notify { + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} + +/* Footer */ + +#footer { + text-align: center; + margin-top: 80px; + padding: 20px; + /*border-top: 1px solid #ddd;*/ + font-size: 90%; +} + +#footer a { padding: 0 2px; } + +::-webkit-scrollbar-track { color: #fefefe; }