Skip to content

Commit

Permalink
chore: use request.user_agent.is_mobile instead of parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
stevekaplan123 committed Jan 21, 2025
1 parent 700ee8f commit c59bb70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions templates/_sidebar.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n %}

<nav id="aboutSidebar">
{% if mobile %}
{% if request.user_agent.is_mobile %}
<h1 class="int-en">{{title}}</h1>
<h1 class="int-he">{{heTitle}}</h1>
{% endif %}
Expand Down Expand Up @@ -42,7 +42,7 @@ <h1 class="int-he">{{heTitle}}</h1>
</ul>
</nav>
<script>
const mobile = "{{mobile}}" === "1";
const mobile = "{{request.user_agent.is_mobile}}" === "True";
if (!mobile) {
const whichPage = "{{whichPage}}";
const item = document.getElementById(whichPage);
Expand Down
2 changes: 1 addition & 1 deletion templates/static/mobile-about-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% block content %}
<link rel="stylesheet" href="{% static 'css/about.css' %}">
<div class="mobileAboutPage">
{% include '_sidebar.html' with whichPage='' title="About Sefaria" heTitle="אודות ספריא" mobile="1" %}
{% include '_sidebar.html' with whichPage='' title="About Sefaria" heTitle="אודות ספריא" %}
</div>
{% endblock %}
{% block footer %} {% endblock %}

0 comments on commit c59bb70

Please sign in to comment.