$changed = 1 if $ispublic;
}
+ # Handle text direction
+ my $tdval = delete $params->{direction} || 'LR';
+
+ unless( $tradition->collation->direction
+ && $tradition->collation->direction eq $tdval ) {
+ try {
+ $tradition->collation->change_direction( $tdval );
+ $changed = 1;
+ } catch {
+ return _json_error( $c, 500, "Error setting direction to $tdval: $@" );
+ }
+ }
+
+
# Handle ownership change
if( exists $params->{'owner'} ) {
# Only admins can update user / owner
my $textinfo = {
textid => $textid,
name => $tradition->name,
+ direction => $tradition->collation->direction || 'LR',
public => $tradition->public || 0,
owner => $tradition->user ? $tradition->user->email : undef,
witnesses => [ map { $_->sigil } $tradition->witnesses ],
$("#edit_textinfo_status").empty();
// Populate the form fields with the current values
// edit_(name, language, public, owner)
- $.each([ 'name', 'language', 'owner' ], function( idx, k ) {
+ $.each([ 'name', 'language', 'owner', 'direction' ], function( idx, k ) {
var fname = '#edit_' + k;
// Special case: language Default is basically language null
if( k == 'language' && selectedTextInfo[k] == 'Default' ) {
<input id="edit_language" type="text" size="12" name="language"/>
<label for="edit_public">Publicly viewable: </label>
<input id="edit_public" type="checkbox" name="public"/><br/>
+ <label for="edit_direction">Text direction: </label>
+ <select id="edit_direction" name="direction">
+ <option value="LR" selected>Left-to-right</option>
+ <option value="RL">Right-to-left</option>
+ <option value="BI">Bidirectional</option>
+ </select><br/>
[% IF c.user_exists -%]
[% IF c.user.get_object.is_admin -%]
<label for="edit_owner">Tradition owner: </label>