Spracheinstellungen bei Waren usw.: Übersetzungsfelder auch mehrzeilig
authorBernd Blessmann <bibi@online.de>
Wed, 9 May 2012 09:15:20 +0000 (11:15 +0200)
committerBernd Blessmann <bibi@online.de>
Wed, 9 May 2012 09:15:20 +0000 (11:15 +0200)
analog zu Beschreibung und Bemerkungen im Hauptfenster.

bin/mozilla/ic.pl
templates/webpages/ic/parts_language_selection.html

index 3eb6738..d6ecbb5 100644 (file)
@@ -2016,6 +2016,10 @@ sub parts_language_selection {
 
         $language->{translation}     = $translation;
         $language->{longdescription} = $longdescription;
+
+        $language->{translation_area}     = ($language->{translation_rows} = $form->numtextrows($language->{translation}, 40)) > 1;
+        $language->{longdescription_rows} = max 4, $form->numtextrows($language->{longdescription}, 40);
+
         last;
       }
     }
index 95ed20d..947f7d0 100644 (file)
     [%- FOREACH row = LANGUAGES %]
     <tr class="listrow[% loop.count % 2 %]">
      <td><input type="hidden" id="id_[% loop.count %]" name="id_[% loop.count %]" value="[% HTML.escape(row.id) %]">[% HTML.escape(row.description) %]</td>
-     <td><input  id="translation_[% loop.count %]" name="translation_[% loop.count %]" value="[% HTML.escape(row.translation) %]"></td>
-     <td><input  id="longdescription_[% loop.count %]" name="longdescription_[% loop.count %]" value="[% HTML.escape(row.longdescription) %]"></td>
+     <td>
+       [%- IF row.translation_area %]
+         <textarea id="translation_[% loop.count %]" name="translation_[% loop.count %]" rows="[% HTML.escape(row.translation_rows) %]" cols=40 wrap="soft">[% HTML.escape(row.translation) %]</textarea>
+       [%- ELSE %]
+         <input  id="translation_[% loop.count %]" name="translation_[% loop.count %]" value="[% HTML.escape(row.translation) %]">
+       [%- END %]
+     </td>
+     <td><textarea id="longdescription_[% loop.count %]" name="longdescription_[% loop.count %]" rows="[% HTML.escape(row.longdescription_rows) %]" cols=40 wrap="soft">[% HTML.escape(row.longdescription) %]</textarea></td>
     </tr>
 
     [%- IF loop.last %]