1. Shlomi Fish
  2. Quad-Pres

Commits

shl...@6a489e09-e8c2-0310-a3fb-a128a961c0b2  committed 9f98e1a

Added support for RTL to the breadcrumbs trail.

  • Participants
  • Parent commits 2a4a2cf
  • Branches default

Comments (0)

Files changed (3)

File installer/perl5/Shlomif/Quad/Pres.pm

View file
 sub get_breadcrumbs_trail
 {
     my $qp = shift;
+    my $sep = shift;
 
     my @abs_coords = @{$qp->{'coords'}};
 
         push @strs, $s;
     }
 
-    return join(" → " , @strs);
+    return join($sep, @strs);
 }
 
 1;

File installer/tests/perl/t/tree.t

View file
 
 use utf8;
 
-use Test::More tests => 8;
+use Test::More tests => 9;
 
 # TEST
 use_ok("Shlomif::Quad::Pres");
         ok($qp); 
 
         # TEST
-        is ($qp->get_breadcrumbs_trail(),
+        is ($qp->get_breadcrumbs_trail(" → "),
             q{<a href="../../">Do it with the GIMP</a> → <a href="../">Basic Areal Effects</a> → <a href="./">Sharpening &amp; Marpening</a>},
             "Testing the breadcrumbs trail",
         );
+
+        # TEST
+        is ($qp->get_breadcrumbs_trail(" ← "),
+            q{<a href="../../">Do it with the GIMP</a> ← <a href="../">Basic Areal Effects</a> ← <a href="./">Sharpening &amp; Marpening</a>},
+            "Testing the breadcrumbs trail",
+        );        
     }
 }

File installer/wml/themes/shlomif-text/template.wml

View file
 <restore withkey />
 </define-tag>
 
+
 <define-tag quadpres_breadcrumbs_trail>
 <div class="bread">
 <:{
-    uniprint $qp->get_breadcrumbs_trail();
+    use utf8;
+    uniprint $qp->get_breadcrumbs_trail(<ifeq "<get-var qp_body_dir />" "rtl" "' ← '" "' → '" />);
 }:>
 </div>
 </define-tag>