]> git.plutz.net Git - shellwiki/blobdiff - themes/default.sh
bugfix editor help: display of original language page
[shellwiki] / themes / default.sh
index 563ea3afdbd8676a428bbb3b3fec30a57bff680e..6c761a747aba50f42ae76a8d7e68caaafe0d650b 100755 (executable)
@@ -74,10 +74,13 @@ theme_editor(){
   [ "$template" ] && acl_read "$template" || template="$page"
 
   theme_page - "Editor: $title" <<-EOF
-       <input checked type=radio class=tab name=edithelp value=edtr id=edtr><label for=edtr>Editor</label>
-       <input         type=radio class=tab name=edithelp value=help id=help><label for=help>Syntax</label>
-       <input         type=radio class=tab name=edithelp value=himg id=himg><label for=himg>Images</label>
-       <input         type=radio class=tab name=edithelp value=hdoc id=hdoc><label for=hdoc>Documents</label>
+       <input checked type=radio class=tab name=edithelp value=edtr id=editor><label for=editor>Editor</label>
+       <input         type=radio class=tab name=edithelp value=help id=syntax><label for=syntax>Syntax</label>
+       <input         type=radio class=tab name=edithelp value=att  id=attach><label for=attach>Attachments</label>
+       $([ "$LANGUAGE_DEFAULT" -a "$LANGUAGE_DEFAULT" != "$LANGUAGE" ] && printf '
+       <input         type=radio class=tab name=edithelp value=att  id=transl><label for=transl>%s</label>
+       ' "$LANGUAGE_DEFAULT"
+       )
        <form class="tab editor" method=POST action="$(HTML "${_BASE}${page%/}/[edit]")">
          <input type=hidden name=session_key value="${SESSION_KEY}"/>
          <textarea name=pagetext>$({ wiki_text "$page" \
@@ -86,7 +89,7 @@ theme_editor(){
          <button type=submit name=action value=cancel>Cancel</button>
        </form>
         <div class="tab syntax">$(wiki "/[wiki]/editorhelp/")</div>
-       <div class="tab help">
+       <div class="tab attach">
        $(for file in "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments"/* "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments"/*; do
          [ "$file" = "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" \
                -a -f "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" ] && continue
@@ -95,16 +98,19 @@ theme_editor(){
            *.[pP][nN][gG]|*.[jJ][pP][gG]|*.[jJ][pP][eE][gG]|*.[gG][iI][fF])
              [ "$page" != "${page%/:$LANGUAGE/}" ] && p=../ || p=''
              att="$(HTML "${file##*/}")"
-             printf '<p class=himg><img src="%s%s">![](%s)</p><ul class=himg><li>[%s]([attachment]/%s)</li><li>[![%s](%s)]([attachment]/%s)</li></ul>' \
+             printf '<p class=aimg><img src="%s%s">![](%s)</p><ul class=aimg><li>[%s]([attachment]/%s)</li><li>[![%s](%s)]([attachment]/%s)</li></ul>' \
                     "$p" "$att" "$att" "$att" "$att" "$att" "$att" "$att"
              ;;
            *)
              att="$(HTML "${file##*/}")"
-             printf '<p class="hdoc">[%s](%s)</p>' "$att" "$att"
+             printf '<p class="adoc">[%s](%s)</p>' "$att" "$att"
              ;;
          esac
        done)
        </div>
+       $(if [ "$LANGUAGE_DEFAULT" -a "$LANGUAGE_DEFAULT" != "$LANGUAGE" ]; then
+         printf '<div class="tab transl">%s</div>' "$(LANGUAGE='' wiki_text "${page%/:$LANGUAGE/}" |HTML)"
+       fi)
        EOF
 }