Skip to content

Commit

Permalink
added RTL support
Browse files Browse the repository at this point in the history
notice: the example project strings are hard coded so in order to have translations there too we need to include them into translation files or somewhere inside that example project.
  • Loading branch information
mohammadrafigh committed May 31, 2016
1 parent d5203d1 commit 7d00a55
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 5 deletions.
5 changes: 3 additions & 2 deletions app/routes/login_page.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ function route_login_page (config) {
return function (req, res, next) {

return res.render('login', {
layout : null,
lang : config.lang
layout : null,
lang : config.lang,
rtl_layout : config.rtl_layout
});

};
Expand Down
3 changes: 3 additions & 0 deletions example/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ var config = {

locale: 'en',

// Set to true to render suitable layout for RTL languages
rtl_layout: false,

// Edit Home Page title, description, etc.
home_meta : {
//title : 'Custom Home Title',
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gulp.task('copy_libs', function () {

var source = [
'node_modules/bootstrap/**/*',
'node_modules/bootstrap-rtl/**/*',
'node_modules/fitvids/**/*',
'node_modules/highlightjs/**/*',
'node_modules/jquery/**/*',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"always-tail": "0.2.0",
"body-parser": "1.14.2",
"bootstrap": "3.3.6",
"bootstrap-rtl": "^3.3.4",
"commander": "2.9.0",
"cookie-parser": "1.4.1",
"debug": "2.2.0",
Expand Down Expand Up @@ -68,4 +69,4 @@
"mocha": "2.4.5",
"supertest": "1.1.0"
}
}
}
39 changes: 39 additions & 0 deletions themes/default/public/styles/raneto.rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
* {
direction: rtl;
unicode-bidi: embed;
font-family: 'Roboto', sans-serif;
}

.header .logo {
margin-right: 20px;
font-size: 20px;
line-height: 34px;
}

.header .search-form {
margin-left: 20px;
}

.footer .copyright {
margin: 0 0 40px 20px;
font-size: 85%;
color: #999;
}

.list-group {
padding-left: unset;
padding-right: 0;
}

.header
.container-fluid
.row
.col-sm-6
form {
float: left !important;
}

.content
.btn-group {
float: left !important;
}
8 changes: 6 additions & 2 deletions themes/default/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<link rel="stylesheet" href="{{config.base_url}}/lib/highlightjs/styles/solarized_light.css">
<link rel="stylesheet" href="{{config.base_url}}/styles/raneto.css">
<link rel="stylesheet" href="{{config.base_url}}/styles/ghostdown.css">
{{#config.rtl_layout}}
<link rel="stylesheet" href="{{config.base_url}}/styles/raneto.rtl.css">
<link rel="stylesheet" href="{{config.base_url}}/lib/bootstrap-rtl/dist/css/bootstrap-rtl.min.css">
{{/config.rtl_layout}}

{{{config.analytics}}}

Expand Down Expand Up @@ -64,7 +68,7 @@

{{#config.allow_editing}}
{{#loggedIn}}

<!-- Modal: Add Page -->
<div class="modal fade" id="addModal" tabindex="-1">
<div class="modal-dialog">
Expand Down Expand Up @@ -103,7 +107,7 @@ <h4 class="modal-title" id="myModalLabel">{{lang.global.reallyDeletePage}}</h4>
</div>
</div>
</div>

{{/loggedIn}}
{{/config.allow_editing}}

Expand Down
4 changes: 4 additions & 0 deletions themes/default/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<link rel="stylesheet" href="{{config.base_url}}/styles/login-form.css">
<link rel="stylesheet" href="{{config.base_url}}/styles/login-style.css">
<link rel="stylesheet" href="{{config.base_url}}/lib/sweetalert/dist/sweetalert.css">
{{#rtl_layout}}
<link rel="stylesheet" href="{{config.base_url}}/styles/raneto.rtl.css">
<link rel="stylesheet" href="{{config.base_url}}/lib/bootstrap-rtl/dist/css/bootstrap-rtl.min.css">
{{/rtl_layout}}

{{{config.analytics}}}

Expand Down

0 comments on commit 7d00a55

Please sign in to comment.