diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo index 112b58179f..2c43eaf1ef 100644 Binary files a/locale/en/LC_MESSAGES/django.mo and b/locale/en/LC_MESSAGES/django.mo differ diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index a94fa8f2d7..39741a72f8 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -1048,9 +1048,15 @@ msgstr "" msgid "Older Activity" msgstr "" -#: templates/elements/login_prompt.html:6 #: templates/registration/register.html:13 +msgid "Sign_Up_Title" +msgstr "Sign Up" + #: templates/registration/register.html:22 +msgid "Sign_Up_Button" +msgstr "Sign Up" + +#: templates/elements/login_prompt.html:6 msgid "Sign Up" msgstr "" @@ -1448,8 +1454,8 @@ msgstr "" "other Pecha users." #: templates/registration/login.html:14 templates/registration/login.html:15 -msgid "You are already logged in as" -msgstr "" +msgid "login_success_message" +msgstr "You are already logged in as {{ user.email }}." #: templates/registration/login.html:18 templates/registration/login.html:19 msgid "Logout." diff --git a/locale/he/LC_MESSAGES/django.mo b/locale/he/LC_MESSAGES/django.mo index 8a77ecccc4..79ece667ed 100644 Binary files a/locale/he/LC_MESSAGES/django.mo and b/locale/he/LC_MESSAGES/django.mo differ diff --git a/locale/he/LC_MESSAGES/django.po b/locale/he/LC_MESSAGES/django.po index ae277c7f9e..0bea6c091e 100644 --- a/locale/he/LC_MESSAGES/django.po +++ b/locale/he/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-25 11:21+0530\n" +"POT-Creation-Date: 2024-10-10 17:28+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -243,7 +243,7 @@ msgstr "" msgid "Sheet ID to delete" msgstr "" -#: sefaria/forms.py:41 sefaria/forms.py:47 sefaria/forms.py:152 +#: sefaria/forms.py:41 sefaria/forms.py:47 sefaria/forms.py:153 #: templates/messages/2022-01-09-user-testing-modal.html:86 #: templates/static/aramaic-translation-contest.html:140 #: templates/static/home.html:362 templates/static/newsletter.html:24 @@ -268,7 +268,7 @@ msgstr "ཡིག་ཆ་ཞིག་འདེམས།" #: sefaria/forms.py:56 msgid "Monastic" -msgstr "དགོན་སྡེ།" +msgstr "གྲྭ་བཙུན།" #: sefaria/forms.py:57 msgid "Teacher" @@ -280,37 +280,33 @@ msgstr "སློབ་མ།" #: sefaria/forms.py:59 msgid "Educated* /Dr / Prof" -msgstr "ཤེས་ལྡན།" +msgstr "བསླབ་པ་མཐར་སོན།" #: sefaria/forms.py:60 msgid "regular user" -msgstr "སྤྱིར་བཏང་སྤྱོད་མཁན།" +msgstr "དཀྱུས་མ།" -#: sefaria/forms.py:66 -msgid "Select an Option" -msgstr "ཡིག་ཆ་ཞིག་འདེམ།" - -#: sefaria/forms.py:95 +#: sefaria/forms.py:96 msgid "A user with that email already exists." msgstr "" -#: sefaria/forms.py:143 +#: sefaria/forms.py:144 msgid "Incorrect mobile_app_key provided" msgstr "" -#: sefaria/forms.py:157 +#: sefaria/forms.py:158 msgid "New password" msgstr "" -#: sefaria/forms.py:158 +#: sefaria/forms.py:159 msgid "Enter New Password" msgstr "གསང་ཚིག་གསར་པ།" -#: sefaria/forms.py:163 +#: sefaria/forms.py:164 msgid "New password confirmation" msgstr "" -#: sefaria/forms.py:165 +#: sefaria/forms.py:166 msgid "Repeat New Password" msgstr "ཡང་བསྐྱར།" @@ -1066,8 +1062,6 @@ msgid "Older Activity" msgstr "" #: templates/elements/login_prompt.html:6 -#: templates/registration/register.html:13 -#: templates/registration/register.html:22 msgid "Sign Up" msgstr "ཐོ་འགོད།" @@ -1425,7 +1419,7 @@ msgstr "" msgid "Log back in" msgstr "" -#: templates/registration/login.html:4 templates/registration/login.html:31 +#: templates/registration/login.html:4 templates/registration/login.html:29 msgid "Log in to Pecha" msgstr "ནང་དུ་འཛུལ་ས།" @@ -1435,27 +1429,27 @@ msgid "" "other Pecha users." msgstr "" -#: templates/registration/login.html:14 templates/registration/login.html:15 +#: templates/registration/login.html:14 msgid "You are already logged in as" msgstr "" -#: templates/registration/login.html:18 templates/registration/login.html:19 +#: templates/registration/login.html:17 msgid "Logout." msgstr "" -#: templates/registration/login.html:35 +#: templates/registration/login.html:33 msgid "Your username and password didn't match. Please try again." msgstr "" -#: templates/registration/login.html:52 templates/sheets.html:497 +#: templates/registration/login.html:50 templates/sheets.html:497 msgid "Login" msgstr "ནང་འཛུལ་གྱིས།" -#: templates/registration/login.html:55 +#: templates/registration/login.html:53 msgid "Forgot your password?" msgstr "གསང་ཚིག་བརྗེད་སོང་ན། འདིར་སྣུན།" -#: templates/registration/login.html:60 +#: templates/registration/login.html:58 msgid "Create a new account" msgstr "ཁ་བྱང་གསར་པ་ཞིག་བཟོས།" @@ -1496,7 +1490,7 @@ msgstr "" #: templates/registration/password_reset_done.html:10 #: templates/registration/password_reset_done.html:11 msgid "An email has been sent with a link to reset your password." -msgstr "" +msgstr "ཁྱེད་ཀྱི་གློག་འཕྲིན་ནང་། གསང་ཚིག་བསྐྱར་སྒྲིག་གི་དྲ་ཐག་བསྐུར་ཡོད།" #: templates/registration/password_reset_email.html:4 #: templates/registration/password_reset_email.txt:3 @@ -1547,7 +1541,15 @@ msgid "" "other people." msgstr "" -#: templates/registration/register.html:26 +#: templates/registration/register.html:13 +msgid "Sign_Up_Title" +msgstr "ཐོ་འགོད་བྱེད་ས།" + +#: templates/registration/register.html:25 +msgid "Sign_Up_Button" +msgstr "ཐོ་འགོད་གྱིས།" + +#: templates/registration/register.html:29 msgid "Already have an account? Log in" msgstr "ཁ་བྱང་བཟོས་ཡོད་ན། ནང་འཛུལ་བྱེད་ས་འདིར་སྣུན།" @@ -2445,5 +2447,66 @@ msgid "" "verse in his commentary on another." msgstr "" +#, fuzzy +#~| msgid "Education" +#~ msgid "Syndication" +#~ msgstr "ཤེས་ཚད།" + +#, fuzzy +#~| msgid "Education" +#~ msgid "Duration" +#~ msgstr "ཤེས་ཚད།" + +#, fuzzy +#~| msgid "Email Address" +#~ msgid "Email address" +#~ msgstr "གློག་འཕྲིན།" + +#, fuzzy +#~| msgid "File" +#~ msgid "File path" +#~ msgstr "ཡིག་ཆ།" + +#, fuzzy +#~| msgid "Email Address" +#~ msgid "IP address" +#~ msgstr "གློག་འཕྲིན།" + +#, fuzzy +#~| msgid "Delete Sheet" +#~ msgid "Delete" +#~ msgstr "ཟིན་བྲིས་འདི་བསུབ།" + +#, fuzzy +#~| msgid "Change Email" +#~ msgid "Change" +#~ msgstr "གློག་འཕྲིན་གཞན་པ་བེད་སྤྱོད་བྱེད།" + +#, fuzzy +#~| msgid "Student" +#~ msgid "Sun" +#~ msgstr "སློབ་མ།" + +#, fuzzy +#~| msgid "Version" +#~ msgid "Permissions" +#~ msgstr "ཐོན་རིམ།" + +#, fuzzy +#~| msgid "Password" +#~ msgid "Password:" +#~ msgstr "གསང་ཚིག" + +#, fuzzy +#~| msgid "Forgot your password?" +#~ msgid "Forgotten your password or username?" +#~ msgstr "གསང་ཚིག་བརྗེད་སོང་ན། འདིར་སྣུན།" + +#~ msgid "Select an Option" +#~ msgstr "ཡིག་ཆ་ཞིག་འདེམ།" + +#~ msgid "login_success_message" +#~ msgstr "གློག་འཕྲིན་འདི། {{ user.email }} དཔེ་ཆ་དྲ་བ་ལ་སྤྱོད་བཞིན་འདུག།" + #~ msgid "Select an option..." #~ msgstr "ཡིག་ཆ་ཞིག་འདེམ།" diff --git a/static/css/s2.css b/static/css/s2.css index eed29d0852..f8a2f2abda 100644 --- a/static/css/s2.css +++ b/static/css/s2.css @@ -11034,6 +11034,50 @@ body #keyboardInputMaster tbody tr td table tbody tr td.pressed { font-family: "Roboto", "Helvetica Neue", "Helvetica", sans-serif; } +.pwa-install-button { + padding: 2px 10px; + font-size: 16px; + font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; + background-color: #b84045; + color: white; + border: var(--talmud-gold) 1px solid; + border-radius: 5px; + cursor: pointer; + position: fixed; /* Fix the position of the button */ + left: 50%; /* Center horizontally */ + transform: translateX(-50%); /* Adjust to center it exactly */ + bottom: 15px; /* Position near the bottom */ + transition: background-color 0.3s ease; /* Smooth background change */ + display: none; /* Initially hidden */ +} + +/* Slide-in animation */ +.pwa-install-button.show { + display: inline-block; + animation: slide-in 0.10s forwards; /* Trigger the slide-in animation */ +} + +/* Keyframes for sliding in the button from the right */ +@keyframes slide-in { + from { + transform: translateX(100px); /* Start off-screen */ + } + to { + transform: translateX(-50%); /* Slide in to the centered position */ + } +} + +.pwa-install-button:hover { + background-color: #a7353b; + transform: translateX(-50%) scale(1.05); /* Keep centering and enlarge the button on hover */ +} + +.pwa-install-button:active { + background-color: #8b2c30; + transform: translateX(-50%) scale(0.98); /* Keep centering on active state */ +} + + #footer .section { display: inline-block; vertical-align: top; diff --git a/static/js/Footer.jsx b/static/js/Footer.jsx index 539a2d17f1..9d0eaecfa1 100644 --- a/static/js/Footer.jsx +++ b/static/js/Footer.jsx @@ -29,12 +29,17 @@ class Footer extends Component { trackLanguageClick(language){ Sefaria.track.setInterfaceLanguage('interface language footer', language); } + render() { if (!Sefaria._siteSettings.TORAH_SPECIFIC) { return null; } return (
Version: 1.3.0 + {/* Install PWA Button */} +
); } diff --git a/static/js/TranslationsBox.jsx b/static/js/TranslationsBox.jsx index 93131efdcc..3323f5628c 100644 --- a/static/js/TranslationsBox.jsx +++ b/static/js/TranslationsBox.jsx @@ -120,12 +120,12 @@ const TranslationsHeader = () => (

connection_pannel.translations

-
+ {/*
connection_pannel.translation.description common.learn_more -
+
*/} ); diff --git a/static/manifest.json b/static/manifest.json index 3ad07fa8ec..9807283a2c 100644 --- a/static/manifest.json +++ b/static/manifest.json @@ -1,55 +1,55 @@ { - "name": "Pecha", - "short_name": "Pecha", - "start_url": "/", - "display": "standalone", - "background_color": "#fdfdfd", - "theme_color": "#db4938", - "orientation": "portrait-primary", - - "icons": [ - { - "src": "https://dev.pecha.org/static/screenshots/icon.png", - "sizes": "144x144", - "type": "image/png", - "purpose": "any" - }, - { - "src": "https://dev.pecha.org/static/screenshots/pecha-icon.png", - "type": "image/png", "sizes": "72x74" - }, - { - "src": "https://dev.pecha.org/static/screenshots/square-icon.png", - "type": "image/png", "sizes": "64x64" - } - ], - - "screenshots": [ + "name": "Pecha", + "short_name": "Pecha", + "start_url": "/", + "display": "standalone", + "background_color": "#fdfdfd", + "theme_color": "#db4938", + "orientation": "portrait-primary", + + "icons": [ { - "src": "https://dev.pecha.org/static/screenshots/desktop-homepage.png", + "src": "/static/screenshots/icon.png", + "sizes": "144x144", "type": "image/png", - "sizes": "1921x993", - "form_factor": "wide" - }, - { - "src": "https://dev.pecha.org/static/screenshots/mobile-collection.jpg", - "type": "image/jpg", - "sizes": "962x2048" + "purpose": "any" }, { - "src": "https://dev.pecha.org/static/screenshots/mobile-homepage.jpg", - "type": "image/jpg", - "sizes": "967x2048" + "src": "https://dev.pecha.org/static/screenshots/pecha-icon.png", + "type": "image/png", "sizes": "72x74" }, { - "src": "https://dev.pecha.org/static/screenshots/mobile-menus.jpg", - "type": "image/jpg", - "sizes": "966x2048" - }, - { - "src": "https://dev.pecha.org/static/screenshots/mobile-sheet.jpg", - "type": "image/jpg", - "sizes": "968x2048" + "src": "https://dev.pecha.org/static/screenshots/square-icon.png", + "type": "image/png", "sizes": "64x64" } - ] - } \ No newline at end of file + ], + + "screenshots": [ + { + "src": "https://dev.pecha.org/static/screenshots/desktop-homepage.png", + "type": "image/png", + "sizes": "1921x993", + "form_factor": "wide" + }, + { + "src": "/static/screenshots/mobile-collection.jpg", + "type": "image/jpg", + "sizes": "1080x1918" + }, + { + "src": "https://dev.pecha.org/static/screenshots/mobile-homepage.jpg", + "type": "image/jpg", + "sizes": "967x2048" + }, + { + "src": "https://dev.pecha.org/static/screenshots/mobile-menus.jpg", + "type": "image/jpg", + "sizes": "966x2048" + }, + { + "src": "https://dev.pecha.org/static/screenshots/mobile-sheet.jpg", + "type": "image/jpg", + "sizes": "968x2048" + } +] +} \ No newline at end of file diff --git a/static/pwa.js b/static/pwa.js new file mode 100644 index 0000000000..fdbadd2f90 --- /dev/null +++ b/static/pwa.js @@ -0,0 +1,72 @@ +let deferredPrompt; + +// Function to check if the app is already installed +function checkIfInstalled() { + // Use matchMedia to check if the app is in standalone mode (PWA is installed) + if (window.matchMedia('(display-mode: standalone)').matches) { + console.log('PWA is already installed'); + hideInstallButton(); // Hide the button if installed + } +} + +// Function to hide the install button +function hideInstallButton() { + const installButton = document.getElementById('install-pwa-button'); + if (installButton) { + installButton.style.display = 'none'; + } +} + +// Function to handle the 'beforeinstallprompt' event +function handleBeforeInstallPrompt(e) { + // Prevent the mini-infobar from appearing + e.preventDefault(); + + // Store the event so it can be triggered later + deferredPrompt = e; + + // Show the install button if the app is not installed + const installButton = document.getElementById('install-pwa-button'); + if (installButton && !window.matchMedia('(display-mode: standalone)').matches) { + installButton.style.display = 'inline-block'; + + // Add a click event listener to trigger the install prompt + installButton.addEventListener('click', () => { + // Hide the button after it's clicked + installButton.style.display = 'none'; + + // Show the install prompt + deferredPrompt.prompt(); + + // Handle the user's response + deferredPrompt.userChoice.then((choiceResult) => { + if (choiceResult.outcome === 'accepted') { + console.log('User accepted the install prompt'); + } else { + console.log('User dismissed the install prompt'); + } + deferredPrompt = null; // Clear the prompt + }); + }); + + // Hide the install button after 10 seconds + setTimeout(() => { + hideInstallButton(); + }, 10000); // 10 seconds in milliseconds + } +} + +// Listen for the 'appinstalled' event and hide the button when PWA is installed +window.addEventListener('appinstalled', () => { + console.log('PWA was installed'); + hideInstallButton(); +}); + +// Wait for the DOM to fully load before attaching event listeners +window.addEventListener('DOMContentLoaded', () => { + // Listen for the 'beforeinstallprompt' event + window.addEventListener('beforeinstallprompt', handleBeforeInstallPrompt); + + // Check if the app is already installed when the page loads + checkIfInstalled(); +}); diff --git a/static/screenshots/icon.png b/static/screenshots/icon.png index 3f4d33cd87..7a19f08158 100644 Binary files a/static/screenshots/icon.png and b/static/screenshots/icon.png differ diff --git a/static/screenshots/mobile-collection.jpg b/static/screenshots/mobile-collection.jpg index 573cebf2ba..f387039300 100644 Binary files a/static/screenshots/mobile-collection.jpg and b/static/screenshots/mobile-collection.jpg differ diff --git a/templates/base.html b/templates/base.html index 001b1acc5e..6303af0d41 100644 --- a/templates/base.html +++ b/templates/base.html @@ -8,7 +8,6 @@ Pecha - A Living Library of Buddhist Text - @@ -237,6 +236,8 @@ } + +