Skip to content

Commit

Permalink
Merge pull request #2111 from Sefaria/feature/sc-24860/add-email-seri…
Browse files Browse the repository at this point in the history
…es-signup-to-parsha-pages

Feature/sc 24860/add email series signup to parsha pages
  • Loading branch information
yitzhakc authored Nov 21, 2024
2 parents cdbc7b2 + ce017b8 commit d80f19c
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 22 deletions.
13 changes: 13 additions & 0 deletions static/css/s2.css
Original file line number Diff line number Diff line change
Expand Up @@ -11530,6 +11530,19 @@ cursor: pointer;
color: white;
background-color: #18345d;
}
.resourcesLink.studyCompanion {
margin-inline-start: 10px;
}
@media screen and (max-width: 900px) {
.resourcesLink.studyCompanion {
margin-inline-start: 0;
}
}
@media screen and (max-width: 900px) {
.resourcesLink.studyCompanion {
margin-inline-start: 0;
}
}
.resourcesLink.blue img {
filter: invert(1);
opacity: 1;
Expand Down
5 changes: 5 additions & 0 deletions static/icons/email-newsletter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 22 additions & 6 deletions static/js/NavSidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const Modules = ({type, props}) => {
"PortalOrganization": PortalOrganization,
"PortalNewsletter": PortalNewsletter,
"RecentlyViewed": RecentlyViewed,
"StudyCompanion": StudyCompanion,
};
if (!type) { return null; }
const ModuleType = moduleTypes[type];
Expand Down Expand Up @@ -153,13 +154,28 @@ const Promo = () =>
</Module>
;

const StudyCompanion = () => (
<Module>
<ModuleTitle>Study Companion</ModuleTitle>
<div><InterfaceText>Get the Weekly Parashah Study Companion in your inbox.</InterfaceText></div>
<a className="button small"
data-anl-event="select_promotion:click|view_promotion:scrollIntoView"
data-anl-promotion_name="Parashah Email Signup - Topic TOC"
href="https://learn.sefaria.org/weekly-parashah/">
<img src="/static/icons/email-newsletter.svg" alt="Sign up for our weekly parashah study companion"/>
<InterfaceText>Sign Up</InterfaceText>
</a>
</Module>
)


const AboutSefaria = ({hideTitle}) => (
<Module>
{!hideTitle ?
<ModuleTitle h1={true}>A Living Library of Torah</ModuleTitle> : null }
<InterfaceText>
<EnglishText>
Sefaria is home to 3,000 years of Jewish texts. We are a nonprofit organization offering free access to texts, translations,
<Module>
{!hideTitle ?
<ModuleTitle h1={true}>A Living Library of Torah</ModuleTitle> : null}
<InterfaceText>
<EnglishText>
Sefaria is home to 3,000 years of Jewish texts. We are a nonprofit organization offering free access to texts, translations,
and commentaries so that everyone can participate in the ongoing process of studying, interpreting, and creating Torah.
</EnglishText>
<HebrewText>
Expand Down
47 changes: 32 additions & 15 deletions static/js/TopicPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,15 @@ const TopicCategory = ({topic, topicTitle, setTopic, setNavTopic, compare, initi
);
});

const sidebarModules = [
let sidebarModules = [
{type: "AboutTopics"},
{type: "Promo"},
{type: "TrendingTopics"},
{type: "SponsorADay"},
];
if (topic === "torah-portions" && Sefaria.interfaceLang === "english") {
sidebarModules.splice(1, 0, {type: "StudyCompanion"});
}

return (
<div className="readerNavMenu noLangToggleInHebrew">
Expand Down Expand Up @@ -440,22 +443,36 @@ return (
: null}
{tpTopImg}
{topicData && topicData.ref ?
<a href={`/${topicData.ref.url}`} className="resourcesLink button blue">
<img src="/static/icons/book-icon-black.svg" alt="Book Icon" />
<span className="int-en">{ topicData.parasha ? Sefaria._('Read the Portion') : topicData.ref.en }</span>
<span className="int-he">{ topicData.parasha ? Sefaria._('Read the Portion') : norm_hebrew_ref(topicData.ref.he) }</span>
</a>
: null}
<div>
<a href={`/${topicData.ref.url}`} className="resourcesLink button blue">
<img src="/static/icons/book-icon-black.svg" alt="Book Icon"/>
<span className="int-en">{topicData.parasha ? Sefaria._('Read the Portion') : topicData.ref.en}</span>
<span className="int-he">{topicData.parasha ? Sefaria._('Read the Portion') : norm_hebrew_ref(topicData.ref.he)}</span>
</a>
{Sefaria.interfaceLang === "english" &&
<a className="resourcesLink button blue studyCompanion"
href="https://learn.sefaria.org/weekly-parashah/"
data-anl-event="select_promotion:click|view_promotion:scrollIntoView"
data-anl-promotion_name="Parashah Email Signup - Parashah Page"
>
<img src="/static/icons/email-newsletter.svg" alt="Sign up for our weekly parashah study companion"/>
<InterfaceText>Get the Free Study Companion</InterfaceText>
</a>}
</div>
: null}
</div>
);}
);
}

const AuthorIndexItem = ({url, title, description}) => {
return (
<div className="authorIndex" >
<a href={url} className="navBlockTitle">
<ContentText text={title} defaultToInterfaceOnBilingual />
</a>
<div className="navBlockDescription">
const AuthorIndexItem = ({
url, title, description
}) => {
return (
<div className="authorIndex">
<a href={url} className="navBlockTitle">
<ContentText text={title} defaultToInterfaceOnBilingual/>
</a>
<div className="navBlockDescription">
<ContentText text={description} defaultToInterfaceOnBilingual />
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion static/js/analyticsEventTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const AnalyticsEventTracker = (function() {
'project', 'panel_type', 'panel_number', 'item_id', 'version', 'content_lang',
'content_id', 'content_type', 'panel_name', 'panel_category', 'position', 'ai',
'text', 'experiment', 'feature_name', 'from', 'to', 'action', 'engagement_value',
'engagement_type', 'logged_in', 'site_lang', 'traffic_type',
'engagement_type', 'logged_in', 'site_lang', 'traffic_type', 'promotion_name'
]);
const EVENT_ATTR = 'data-anl-event';
const FIELD_ATTR_PREFIX = 'data-anl-';
Expand Down Expand Up @@ -226,6 +226,7 @@ const AnalyticsEventTracker = (function() {
if (entry.isIntersecting) {
const scrollIntoViewEvent = new CustomEvent(eventType, {bubbles: true});
entry.target.dispatchEvent(scrollIntoViewEvent);
observer.unobserve(entry.target); // Stop observing the node
}
});
});
Expand Down

0 comments on commit d80f19c

Please sign in to comment.