Skip to content

Commit

Permalink
Merge pull request #3344 from camptocamp/mobile-theme
Browse files Browse the repository at this point in the history
Add the missing theme in the mobile redirect
  • Loading branch information
sbrunner committed Dec 20, 2017
2 parents 4bef587 + 60e2ac0 commit f30107a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions c2cgeoportal/pyramid_.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ def new_f(root, request):
)
# permalink theme: recover the theme for generating custom viewer.js url
config.add_route(
"{0!s}theme".format(route_name),
"{0!s}{1!s}theme/{{themes}}".format(route, "" if route[-1] == "/" else "/"),
"{}theme".format(route_name),
"{}{}theme/{{themes}}".format(route, "" if route[-1] == "/" else "/"),
request_method="GET",
)
config.add_view(
Entry,
decorator=add_interface,
attr="get_ngeo_permalinktheme_vars",
route_name="{0!s}theme".format(route_name),
route_name="{}theme".format(route_name),
renderer=renderer,
permission=permission
)
Expand Down
4 changes: 4 additions & 0 deletions c2cgeoportal/scripts/import_ngeo_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ def main():
<script>
var small_screen = window.matchMedia ? window.matchMedia('(max-width: 1024px)') : false;
if (small_screen && (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch)) {
% if "themes" in request.matchdict:
window.location = "${request.route_url('mobiletheme', themes=request.matchdict['themes'], _query=dict(request.GET)) | n}";
% else:
window.location = "${request.route_url('mobile', _query=dict(request.GET)) | n}";
% endif
}
</script>
% endif
Expand Down

0 comments on commit f30107a

Please sign in to comment.