Skip to content

Commit

Permalink
Merge pull request #2293 from Sefaria/feature/sc-31149/introduce-togg…
Browse files Browse the repository at this point in the history
…le-banner-changes

feat: [sc-31149] Introduce toggle-banner changes (phase 4 - deploy ~Feb 2)
  • Loading branch information
akiva10b authored Feb 2, 2025
2 parents 4d2c761 + b54190f commit 09ba5ec
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 29 deletions.
42 changes: 25 additions & 17 deletions static/css/s2.css
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ div:has(#bannerMessage) + .readerApp.singlePanel .mobileNavMenu {
opacity: 0.4;
}
.mobileNavMenu a.blue {
background-color: #18345D;
background-color: var(--sefaria-blue);
color: white;
border-bottom: unset;
}
Expand Down Expand Up @@ -1064,7 +1064,7 @@ div.interfaceLinks-row a {
color: #666;
}
#interruptingMessage.sefariaModalContentBox {
background-color: #18345D;
background-color: var(--sefaria-blue);
color: white;
padding: 50px 70px;
border-color: transparent;
Expand Down Expand Up @@ -3907,7 +3907,7 @@ details .open-details::before {
margin-top: 5px;
}
.versionBlock .versionDetails .versionDetailsInformation .versionDetailsElement.versionBuyLink a{
color: #18345D;
color: var(--sefaria-blue);
}
.versionBlock .versionDetails .versionDetailsLabel, .versionBlock .versionDetails .versionDetailsLabel:hover{
text-decoration: none;
Expand Down Expand Up @@ -8091,8 +8091,8 @@ a .button:hover {
}
.button.appButton {
box-shadow: none;
border: 2px solid #18345D;
color: #18345D;
border: 2px solid var(--sefaria-blue);
color: var(--sefaria-blue);
}
.button.appButton img {
margin-inline-end: 5px;
Expand Down Expand Up @@ -11238,31 +11238,39 @@ cursor: pointer;
.profile-page .social-icon:hover img {
opacity: 0.6;
}
#staticContentWrapper .editorToggleHeader {
margin: revert;
}
.editorToggleHeader {
width: 100%;
background-color: #18345D;
padding-inline: 10%;
background-color: var(--sefaria-blue);
color: white;
height: 60px;
height: 72px;
font-size: 16px;
margin-top: -60px;
margin-left: -12px;
margin-bottom: 80px;
padding-right: 12px;
display: flex;
justify-content: center;
gap: 5px;
align-items: center;
position: relative;
left: 0;
}

.interface-hebrew .editorToggleHeader {
direction: rtl;
}
.editorToggleHeader .button {
white-space: nowrap;
padding: 5px 8px;
margin-inline-start: 15px;
margin-top: 5px;
height: 30px;
letter-spacing: 0;
margin-inline-end: 15px;
}

.editorToggleHeader .learnMore {
text-decoration: underline;
color: white;
white-space: nowrap;
margin-top: -5px;
}
.feedbackOverlay {
position: fixed;
Expand Down Expand Up @@ -11573,7 +11581,7 @@ cursor: pointer;
}
.resourcesLink.blue {
color: white;
background-color: #18345d;
background-color: var(--sefaria-blue);
}
.resourcesLink.studyCompanion {
margin-inline-start: 10px;
Expand Down Expand Up @@ -11718,7 +11726,7 @@ cursor: pointer;
align-items: center;
text-align: center;
cursor: pointer;
background: #18345d;
background: var(--sefaria-blue);
color: #fff;
border-radius: 6px;
box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
Expand Down Expand Up @@ -12787,7 +12795,7 @@ a.topicLexiconTitle.contentText {
right: 0;
color: white;
z-index: 9999;
background-color: #18345D;
background-color: var(--sefaria-blue);
padding: 20px;
line-height: 1.6;
text-align: center;
Expand Down
5 changes: 1 addition & 4 deletions static/css/sheets.css
Original file line number Diff line number Diff line change
Expand Up @@ -1628,12 +1628,9 @@ body.hasBannerMessage .sheetsEditNavTop {
padding: 16px 20px;
margin-bottom: 0;
}
.sheetsEditNavTop .button {
.sheetsEditNavTop #save {
background-color: #212e50;
border-color: #212e50;
padding: 12px 24px;
}
.sheetsEditNavTop .button {
padding: 5px 12px;
}
#customTextLanguageToggle {
Expand Down
12 changes: 7 additions & 5 deletions static/js/UserProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,10 @@ UserProfile.propTypes = {

const EditorToggleHeader = ({usesneweditor}) => {
const [feedbackHeaderState, setFeedbackHeaderState] = useState("hidden")

const text = <InterfaceText>{usesneweditor ? "You are currently testing the new Sefaria editor." : "You are currently using the old Sefaria editor."}</InterfaceText>;
const buttonText = <InterfaceText>{usesneweditor ? "Go back to old version" : "Try the new version"}</InterfaceText>;
const old_editor_msg = "You are currently using an outdated version of Sefaria's source sheet editor. This version will no longer be supported starting March 17, 2025. Start using the new editor now, or learn more about this important change.";
const new_editor_msg = "You are currently using the most up-to-date source sheet editor. Starting March 17, 2025, you will no longer be able to switch to an older version.";
const text = <InterfaceText>{usesneweditor ? new_editor_msg : old_editor_msg}</InterfaceText>;
const buttonText = <InterfaceText>{usesneweditor ? "Go Back to Old Version" : "Switch to New Editor"}</InterfaceText>;

const sendFeedback = () => {

Expand Down Expand Up @@ -541,14 +542,15 @@ const EditorToggleHeader = ({usesneweditor}) => {
setFeedbackHeaderState("enableOverlay")
}
}
const buttonLink = (usesneweditor ? "/disable_new_editor" : "");
const learn_more_link = Sefaria._v({"en": "https://www.sefaria.org/sheets/621008", "he": "https://www.sefaria.org/sheets/621013"})

return (
<>
<div className="editorToggleHeader sans-serif">{text}
<a href="#" onClick={()=>toggleFeedbackOverlayState()} className="button white" role="button">{buttonText}</a>
<a href={learn_more_link} className="learnMore"><InterfaceText>Learn More</InterfaceText></a>
</div>
{feedbackHeaderState != "hidden" ? <div className="feedbackOverlay">{overlayContent}</div> : null}
{feedbackHeaderState !== "hidden" ? <div className="feedbackOverlay">{overlayContent}</div> : null}
</>
)
}
Expand Down
8 changes: 5 additions & 3 deletions static/js/sefaria/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Strings = {
"Categories": "קטגוריות",

// Texts Page
"Learn More": "לקריאה נוספת",
"Learn More": "למדו עוד",
"Learning Schedules": "לוח לימוד יומי",
"Teach with Sefaria": "מלמדים עם ספריא",
"Visualizations": "תרשימים גרפיים",
Expand Down Expand Up @@ -526,9 +526,11 @@ const Strings = {
"Missing features": "תכונות חסרות",
"Tell us about it...": "ספר/י לנו על כך...",
"Submit Feedback": "לשליחת המשוב",
"You are currently using the most up-to-date source sheet editor. Starting March 17, 2025, you will no longer be able to switch to an older version.": "הנכם משתמשים בגרסה העדכנית ביותר של התוכנה לעריכת דפי מקורות בספריא. החל מה-17.3.2025, לא יהיה ניתן לערוך דפי מקורות בעזרת גרסאות מוקדמות יותר של תוכנת העריכה.",
"You are currently using an outdated version of Sefaria's source sheet editor. This version will no longer be supported starting March 17, 2025. Start using the new editor now, or learn more about this important change.": "הנכם משתמשים בגרסה מוקדמת של התוכנה לעריכת דפי מקורות בספריא. החל מה-17.3.2025, לא יהיה ניתן לערוך דפי מקורות בעזרת גרסה זו של תוכנת העריכה. אנו ממליצים להתחיל להשתמש בגרסה המעודכנת של התוכנה.",
"Go Back to Old Version": "חזור לגרסה הישנה",
"Switch to New Editor": "עבור לעורך חדש",
"Thank you!": "תודה רבה!",
"You are currently testing the new Sefaria editor.": "ברגע זה הינך עושה שימוש בעורך החדש של ספריא",
"You are currently using the old Sefaria editor.": "כעת הינך עושה שימוש בגרסה הישנה של עורך ספריא",
"Try the new version": "להתנסוּת בגרסה החדשה",
"Your feedback is greatly appreciated. You can now edit your sheets again using the old source sheet editor. If you have any questions or additional feedback you can reach us at": "אנחנו מעריכים מאוד את המשוב שלך. כעת באפשרותך לחזור לערוך את הדפים שלך באמצעות עורך המסמכים הישן. לשאלות או למשוב נוסף אפשר לפנות אלינו בדוא\"ל:",

Expand Down
18 changes: 18 additions & 0 deletions templates/sheets.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,27 @@
<!-- CSS placed here so it has precedence over other sheets in base.html -->
<link rel="stylesheet" href="{% static 'css/sheets.css' %}">
<link rel="stylesheet" href="{% static 'css/sheets-print.css' %}" media="print" />

<div id="sheetsContent" data-interface-lang="{{ request.interfaceLang }}">

<div class="sheetsEditNavTop">
<div class="editorToggleHeader sans-serif">
<span class="int-en">You are currently using an outdated version of Sefaria’s source sheet editor. This version will no longer be supported starting March 17, 2025. Start using the new editor now, or learn more about this important change.</span>
<span class="int-he">הנכם משתמשים בגרסה מוקדמת של התוכנה לעריכת דפי מקורות בספריא. החל מה-17.3.2025, לא יהיה ניתן לערוך דפי מקורות בעזרת גרסה זו של תוכנת העריכה. אנו ממליצים להתחיל להשתמש בגרסה המעודכנת של התוכנה.</span>
<a href="/enable_new_editor" class="button white" role="button">
<span class="int-en">Switch to New Editor</span>
<span class="int-he">עבור לעורך חדש</span>
</a>
{% if request.interfaceLang == 'english' %}
<a href="https://www.sefaria.org/sheets/621008" class="learnMore">
<span class="int-en">Learn More</span>
</a>
{% else %}
<a href="https://www.sefaria.org/sheets/621013" class="learnMore">
<span class="int-he">למידע נוסף</span>
</a>
{% endif %}
</div>
<div class="sheetsMenuBar" role="menu">
<div class="sheetsMenuBarInner">
<div class="sheetsMenuBarCommands">
Expand Down

0 comments on commit 09ba5ec

Please sign in to comment.