]> git.plutz.net Git - shellwiki/commitdiff
additional editor tab for translation aid
authorPaul Hänsch <paul@plutz.net>
Mon, 14 Aug 2023 18:29:44 +0000 (20:29 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 14 Aug 2023 18:29:44 +0000 (20:29 +0200)
themes/default.css
themes/default.sh

index 1823d7781758e6db6227afb7e606c284faccb5fc..3e924b57de1d8702a7e0b116d6670469f27b488f 100644 (file)
@@ -115,17 +115,19 @@ main pre {
   margin-bottom: 1em;
 }
 
+.tab[name=edithelp] ~ .tab.editor textarea,
+.tab[name=edithelp] ~ .tab.syntax,
+.tab[name=edithelp] ~ .tab.attach,
+.tab[name=edithelp] ~ .tab.transl {
+  background-color: #FFF;
+  min-height: 20em; min-height: 50vh;
+}
+
 .tab[name=edithelp] ~ .tab.editor textarea {
   width: 100%;
-  min-height: 20em; min-height: 50vh;
   font-family: monospace;
   font-size: inherit;
 }
-.tab[name=edithelp] ~ .tab.syntax,
-.tab[name=edithelp] ~ .tab.attach {
-  background-color: #FFF;
-  min-height: 20em; min-height: 50vh;
-}
 
 .tab[name=edithelp] ~ .tab.attach {
   padding-top: 1em;
@@ -137,9 +139,15 @@ main pre {
   margin-left: -6em;
 }
 
+.tab[name=edithelp] ~ .tab.transl {
+  font-family: monospace;
+  white-space: pre;
+}
+
 .tab[name=edithelp]#editor:checked ~ .tab.editor,
 .tab[name=edithelp]#syntax:checked ~ .tab.syntax,
-.tab[name=edithelp]#attach:checked ~ .tab.attach {
+.tab[name=edithelp]#attach:checked ~ .tab.attach,
+.tab[name=edithelp]#transl:checked ~ .tab.transl {
   display: block;
 }
 
index bb85450e05f4b3d2651932d4a705e8c230894f5a..b4dfe16bf9ff91950818e00ee777fe80606c7503 100755 (executable)
@@ -77,6 +77,10 @@ theme_editor(){
        <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" \
@@ -104,6 +108,9 @@ theme_editor(){
          esac
        done)
        </div>
+       $(if [ "$LANGUAGE_DEFAULT" -a "$LANGUAGE_DEFAULT" != "$LANGUAGE" ]; then
+         printf '<div class="tab transl">%s</div>' "$(wiki_text "${page%/:$LANGUAGE/}" |HTML)"
+       fi)
        EOF
 }