# HG changeset patch # User Christophe Lincoln # Date 1390601328 -3600 # Node ID 6dfd1c3a2fdf42b0e0e0464c78e4bf6a3c1edd6e # Parent 3ca497430ce9036163d03acab5f5577f3c644308 Improved added some functions diff -r 3ca497430ce9 -r 6dfd1c3a2fdf .hgignore --- a/.hgignore Tue Jan 21 00:03:00 2014 +0100 +++ b/.hgignore Fri Jan 24 23:08:48 2014 +0100 @@ -1,2 +1,5 @@ cache/ content/wiki/index.txt +content/blog/ +content/cloud/ +content/forum/ diff -r 3ca497430ce9 -r 6dfd1c3a2fdf index.cgi --- a/index.cgi Tue Jan 21 00:03:00 2014 +0100 +++ b/index.cgi Fri Jan 24 23:08:48 2014 +0100 @@ -361,17 +361,32 @@ EOT } -# CM tools (edit, diff, etc). +# CM tools (edit, diff, etc) for auth users wiki_tools() { - cat << EOT + if check_auth; then + cat << EOT
$(gettext "Edit document") $(gettext "Last diff") $(gettext "File log") - $(gettext "Dashboard") - $([ "$HG" == "yes" ] && echo "Hg Log") + $(gettext 'Dashboard') +EOT + [ "$HG" == "yes" ] && echo "Hg Log" + echo "
" + fi +} + +# Built-in Dashboard tools and ADMIN_TOOLS from plugins +dashboard_tools() { + if check_auth; then + cat << EOT +
+ Activity log + Pages list + Dashboard
EOT + fi } # Get and display Gravatar image: get_gravatar email size @@ -504,12 +519,8 @@ user_box # Main activity if [ "$d" == "log" ]; then - echo "

$(gettext "Activity")

" - if check_auth; then - echo "
" - echo "Dashboard" - echo "
" - fi + dashboard_tools + echo "

$(gettext "Activity log")

" echo '
'
 			if [ -f "$cache/log/activity.log" ]; then
 				IFS="|"
@@ -528,7 +539,9 @@
 			echo '
' html_footer && exit 0 fi + # Document activity get_lang + wiki_tools echo "

$(gettext "Activity for:") $d

" echo '
'
 		if [ -f "$cache/$d/activity.log" ]; then
@@ -537,9 +550,6 @@
 			gettext "No log for: $d"; echo
 		fi
 		echo '
' - if check_auth; then - wiki_tools - fi html_footer ;; *\ ls\ *) @@ -547,19 +557,16 @@ header html_header user_box + dashboard_tools echo "

$(gettext "Pages list")

" - if check_auth; then - echo "
" - echo "Dashboard" - echo "
" - fi echo '
'
 		cd ${wiki}
 		for d in $(find . -type f | sed s'/.\///')
 		do
 			cat << EOT
 ${d%.txt} : \
-$(gettext "Remove")
+$(gettext "Remove") || \
+$(gettext "Edit")
 EOT
 		done
 		echo '
' @@ -579,6 +586,7 @@ html_header user_box get_lang + wiki_tools echo "

$(gettext "Diff for:") $d

" echo '
'
 		if [ -f "$cache/$d/$date.diff" ]; then
@@ -591,9 +599,6 @@
 			gettext "No diff for: $d"; echo
 		fi
 		echo '
' - if check_auth; then - wiki_tools - fi html_footer ;; *\ login\ *) @@ -677,7 +682,6 @@ if check_auth && ! admin_user; then ADMIN_TOOLS="" fi - echo "

$d

" if check_auth; then cat << EOT
@@ -687,6 +691,8 @@ $ADMIN_TOOLS
+

$d

+
 Users     : $users
 Wiki      : $docs ($wikisize)
@@ -753,6 +759,7 @@
 		html_header
 		user_box
 		get_lang
+		
 		# Generate a default index on first run
 		if [ ! -f "$wiki/$index.txt" ]; then
 			if ! default_index; then
@@ -760,12 +767,25 @@
 				html_footer && exit 0
 			fi
 		fi
+		
 		# Check cache dir
 		if [ ! -w "$cache" ]; then
 			echo "
Directory : cache/ is not writable"
 			echo "Command   : install -m 0777 -d $tiny/cache
" html_footer && exit 0 fi + + # Wiki tools and Hg warning if enable but not initiated + if [ "$HG" == "yes" ] && [ ! -d "$content/.hg" ]; then + echo '

' + gettext "Mercurial is enabled but no repository found" + echo ": Hg init" + echo '

' + fi + + # Wiki tools + wiki_tools + # Wiki document if [ ! -f "$wiki/$d.txt" ]; then echo "

$d

" @@ -778,15 +798,6 @@ cat $wiki/$d.txt | wiki_parser fi fi - if check_auth; then - wiki_tools - if [ "$HG" == "yes" ] && [ ! -d "$content/.hg" ]; then - echo '

' - gettext "Mercurial is enabled but no repository found" - echo ": Hg init" - echo '

' - fi - fi html_footer ;; esac diff -r 3ca497430ce9 -r 6dfd1c3a2fdf plugins/cloud/cloud.cgi --- a/plugins/cloud/cloud.cgi Tue Jan 21 00:03:00 2014 +0100 +++ b/plugins/cloud/cloud.cgi Fri Jan 24 23:08:48 2014 +0100 @@ -87,11 +87,18 @@ gettext "You must be logged in to use the Cloud." exit 1 fi - cat << EOT + cat << EOT + +

Cloud files

+

$(gettext "Upload files on the cloud to share them with some other people -or use them in your documents content.") +or use them in your documents content. Tip: Drag and Drop files from you +desktop.")

-
- Activity - Raw files +

Files: $files | Size: $size -

+

EOT echo '
'
 		# List all Cloud files
diff -r 3ca497430ce9 -r 6dfd1c3a2fdf plugins/keygen/keygen.cgi
--- a/plugins/keygen/keygen.cgi	Tue Jan 21 00:03:00 2014 +0100
+++ b/plugins/keygen/keygen.cgi	Fri Jan 24 23:08:48 2014 +0100
@@ -38,7 +38,7 @@
 			*\ md5sum\ *) echo "$keygen" | md5sum | awk '{print $1}' ;;
 			*\ sha256sum\ *) echo "$keygen" | sha256sum | awk '{print $1}' ;;
 			*\ sha512sum\ *) echo "$keygen" | sha512sum | awk '{print $1}' ;;
-			*) gettext "Encrypted key" ;;
+			*) echo "--" ;;
 		esac
 		# Random password
 		cat << EOT
diff -r 3ca497430ce9 -r 6dfd1c3a2fdf style.css
--- a/style.css	Tue Jan 21 00:03:00 2014 +0100
+++ b/style.css	Fri Jan 24 23:08:48 2014 +0100
@@ -133,7 +133,7 @@
 /* Content */
 
 #content {
-	margin: 40px auto;
+	margin: 50px auto;
 	padding: 0 20px;
 	text-align: justify;
 	max-width: 680px;
@@ -212,12 +212,9 @@
 	background-repeat: no-repeat;
 }
 
-#tools { 
-	padding-top: 10px; 
-	margin: 20px 0px; 
-	/*border-top: 1px dotted #ccc;
-	position: fixed;
-	bottom: 10px;*/
+#tools {
+	position: absolute;
+	top: 68px;
 }
 #tools a { text-decoration: none; margin: 4px 6px 4px 0px; }
 
@@ -283,7 +280,10 @@
 
 /* Plugins CSS */
 
-.blogpost { border-bottom: 1px dotted #ddd; }
-.post-tools { border-bottom: 1px dotted #ddd; padding: 4px 0;}
+
+.post-tools { 
+	border-top: 1px dotted #ddd;
+	border-bottom: 1px dotted #ddd;
+	padding: 4px 0; }
 .post-tools a { text-decoration: none; }
 .post-tools a:hover { text-decoration: underline; }