Skip to content

Commit

Permalink
fixes #15 - rtl for file formats
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Aug 17, 2017
1 parent 4f2a315 commit 45b6712
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.heading, .module-heading, a, p, .dataset-list, .search-form, h1,
#dataset-resources, .additional-info, .tags, td.dataset-details, th.dataset-label,
.context-info, .flash-messages, .page_primary_action, .breadcrumb,
.media-item
.media-item, .nav-item
{
direction: rtl;
text-align: right;
Expand Down Expand Up @@ -33,3 +33,7 @@
.homepage .module-search .tags h3, .homepage .module-search .tags .tag {
float: right;
}

.nav-facet .nav-item a span {
padding-right: 15px;
}
13 changes: 13 additions & 0 deletions ckan/ckanext-odata_org_il/ckanext/odata_org_il/fanstatic/rtl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$(function() {
$('.nav-facet .nav-item a span').each(function(i, elt) {
var $elt = $(elt);
var txt = $elt.text();
var tmp = txt.split(" ");
if (tmp.length > 1 && tmp[tmp.length-1].length > 1 && tmp[tmp.length-1][0] == "(") {
txt = tmp.slice(0, tmp.length-1).join(" ");
var mark = (CKAN_LANG=="he") ? " ‏" : " ‎";
txt += mark + tmp[tmp.length-1];
$elt.html(txt);
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
{% resource 'odata_org_il/rtl.css' %}
{% endif %}
{% endblock %}

{% block scripts %}
{{ super() }}
<script>CKAN_LANG="{{request.environ.CKAN_LANG}}";</script>
{% resource 'odata_org_il/rtl.js' %}
{% endblock -%}

0 comments on commit 45b6712

Please sign in to comment.