Allow setting text direction.
Errietta Kostala [Mon, 11 May 2015 09:19:17 +0000 (09:19 +0000)]
lib/stemmaweb/Controller/Root.pm
root/src/index.tt

index 7159680..66a0d92 100644 (file)
@@ -123,12 +123,15 @@ sub newtradition :Local :Args(0) {
        my $name = $c->request->param('name') || 'Uploaded tradition';
        my $lang = $c->request->param( 'language' ) || 'Default';
        my $public = $c->request->param( 'public' ) ? 1 : undef;
+       my $direction = $c->request->param('direction') || 'LR';
+
        my( $ext ) = $upload->filename =~ /\.(\w+)$/;
        my %newopts = (
                'name' => $name,
                'language' => $lang,
                'public' => $public,
-               'file' => $upload->tempname
+               'file' => $upload->tempname,
+               'direction' => $direction,
                );
 
        my $tradition;
index 4066c6e..ad6ab59 100644 (file)
@@ -225,6 +225,15 @@ var textOnLoad = "[% withtradition %]";
             <input id="new_name" type="text" name="name" size="40"/><br/>
             <label for="new_lang">Primary language of the text: </label>
             <input id="new_lang" type="text" name="language" size="20"/><br/>
+
+            <label for="direction">Text direction:</label>
+
+            <select name="direction" id="direction">
+                <option value="LR" selected>Left to Right</option>
+                <option value="RL">Right to Left</option>
+                <option value="BI">Bi-directional</option>
+            </select><Br/>
+
             <label for="new_public">Allow public display: </label>
             <input id="new_public" name="public" type="checkbox"/><br/>
         </form>