Skip to content

Commit

Permalink
Staging (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lungsangg authored Sep 12, 2024
2 parents ec632dd + 27c5191 commit 1dfb334
Show file tree
Hide file tree
Showing 77 changed files with 2,692 additions and 2,951 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,5 @@ log/*
/dockerData

.env
.envrc
.envrc
etc
4 changes: 2 additions & 2 deletions locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3099,8 +3099,8 @@ msgid "to save your work."
msgstr "以保存你的工作。"

#: templates/sheets.html:806
msgid "Made with the Sefaria Source Sheet Builder"
msgstr "使用Sefaria来源表生成器制作"
msgid "Made with the Pecha Source Sheet Builder"
msgstr "使用Pecha来源表生成器制作"

#: templates/sheets.html:817
msgid "Add Highlight"
Expand Down
2 changes: 1 addition & 1 deletion reader/browsertest/basic_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def body(self):
self.click_sidebar_entry(section)
self.click_resources_on_sidebar()

self.click_sidebar_button("Compare Text")
self.click_sidebar_button("panel.compare_text")
self.driver.find_element_by_css_selector('.readerNavMenuMenuButton').click()

self.click_sidebar_button("Sheets")
Expand Down
24 changes: 12 additions & 12 deletions sefaria/helper/community_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ def get_community_page_data(language="english", refresh=False):

urls = {
"english": {
"parashah": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vSoHRVY9Z5MNhERjolxXzQ6Efp3SFTniHMgkSORWFPlkwoj5ppYeP8AyTX7yG_LcQ3p165iRNfOpOSZ/pub?output=csv',
"calendar": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vSoHRVY9Z5MNhERjolxXzQ6Efp3SFTniHMgkSORWFPlkwoj5ppYeP8AyTX7yG_LcQ3p165iRNfOpOSZ/pub?gid=1789079733&single=true&output=csv',
"discover": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vSoHRVY9Z5MNhERjolxXzQ6Efp3SFTniHMgkSORWFPlkwoj5ppYeP8AyTX7yG_LcQ3p165iRNfOpOSZ/pub?gid=2070604890&single=true&output=csv',
"featured": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vSoHRVY9Z5MNhERjolxXzQ6Efp3SFTniHMgkSORWFPlkwoj5ppYeP8AyTX7yG_LcQ3p165iRNfOpOSZ/pub?gid=1926549189&single=true&output=csv',
"parashah": 'https://docs.google.com/spreadsheets/d/1Zaaa1TMGu3G3tiI3PRCKL1LssZVLtHUCd9MKS8fN-Ps/pub?gid=0&single=true&output=csv',
"calendar": 'https://docs.google.com/spreadsheets/d/1jIDo1Iz8jpmozl-3UZ6bZDyE0Q8Rc0Vp-4DAVM-FOoE/pub?gid=999061792&single=true&output=csv',
"discover": 'https://docs.google.com/spreadsheets/d/1C1ia7sFmZARZtGZx5WxX95nl3NHo0BwsIxkj3hbFJ1I/pub?gid=1865340931&single=true&output=csv',
"featured": 'https://docs.google.com/spreadsheets/d/1tV_XZAuH9ZZSQlUtHs-o0wNMHTgm7JQ6eGAU_jPotm8/pub?gid=261076981&single=true&output=csv',
},
"hebrew": {
"parashah": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRefP0BMml1sC6Ic50t2ekkLLIh3SIH9uYEBjWmdRwmBGs0-NDFFhjU3vW_tFzj_ATpK2PwqNdpVwQ4/pub?gid=0&single=true&output=csv',
"calendar": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRefP0BMml1sC6Ic50t2ekkLLIh3SIH9uYEBjWmdRwmBGs0-NDFFhjU3vW_tFzj_ATpK2PwqNdpVwQ4/pub?gid=1789079733&single=true&output=csv',
"discover": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRefP0BMml1sC6Ic50t2ekkLLIh3SIH9uYEBjWmdRwmBGs0-NDFFhjU3vW_tFzj_ATpK2PwqNdpVwQ4/pub?gid=2070604890&single=true&output=csv',
"featured": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRefP0BMml1sC6Ic50t2ekkLLIh3SIH9uYEBjWmdRwmBGs0-NDFFhjU3vW_tFzj_ATpK2PwqNdpVwQ4/pub?gid=1926549189&single=true&output=csv',
"parashah": 'https://docs.google.com/spreadsheets/d/1Zaaa1TMGu3G3tiI3PRCKL1LssZVLtHUCd9MKS8fN-Ps/pub?gid=271466206&single=true&output=csv',
"calendar": 'https://docs.google.com/spreadsheets/d/1jIDo1Iz8jpmozl-3UZ6bZDyE0Q8Rc0Vp-4DAVM-FOoE/pub?gid=0&single=true&output=csv',
"discover": 'https://docs.google.com/spreadsheets/d/1C1ia7sFmZARZtGZx5WxX95nl3NHo0BwsIxkj3hbFJ1I/pub?gid=0&single=true&output=csv',
"featured": 'https://docs.google.com/spreadsheets/d/1tV_XZAuH9ZZSQlUtHs-o0wNMHTgm7JQ6eGAU_jPotm8/pub?gid=0&single=true&output=csv',
},
"chinese": {
"parashah": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRefP0BMml1sC6Ic50t2ekkLLIh3SIH9uYEBjWmdRwmBGs0-NDFFhjU3vW_tFzj_ATpK2PwqNdpVwQ4/pub?gid=0&single=true&output=csv',
"calendar": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRefP0BMml1sC6Ic50t2ekkLLIh3SIH9uYEBjWmdRwmBGs0-NDFFhjU3vW_tFzj_ATpK2PwqNdpVwQ4/pub?gid=1789079733&single=true&output=csv',
"discover": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRefP0BMml1sC6Ic50t2ekkLLIh3SIH9uYEBjWmdRwmBGs0-NDFFhjU3vW_tFzj_ATpK2PwqNdpVwQ4/pub?gid=2070604890&single=true&output=csv',
"featured": 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRefP0BMml1sC6Ic50t2ekkLLIh3SIH9uYEBjWmdRwmBGs0-NDFFhjU3vW_tFzj_ATpK2PwqNdpVwQ4/pub?gid=1926549189&single=true&output=csv',
"parashah": 'https://docs.google.com/spreadsheets/d/1Zaaa1TMGu3G3tiI3PRCKL1LssZVLtHUCd9MKS8fN-Ps/pub?gid=1623720371&single=true&output=csv',
"calendar": 'https://docs.google.com/spreadsheets/d/1jIDo1Iz8jpmozl-3UZ6bZDyE0Q8Rc0Vp-4DAVM-FOoE/pub?gid=205934703&single=true&output=csv',
"discover": 'https://docs.google.com/spreadsheets/d/1C1ia7sFmZARZtGZx5WxX95nl3NHo0BwsIxkj3hbFJ1I/pub?gid=1672289050&single=true&output=csv',
"featured": 'https://docs.google.com/spreadsheets/d/1tV_XZAuH9ZZSQlUtHs-o0wNMHTgm7JQ6eGAU_jPotm8/pub?gid=316551886&single=true&output=csv',
},
}

Expand Down
4 changes: 3 additions & 1 deletion sefaria/local_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from decoder import private_key_1
from dotenv import load_dotenv
from google_auth_oauthlib.flow import Flow

load_dotenv()

Expand Down Expand Up @@ -264,7 +265,8 @@
GOOGLE_OAUTH2_CLIENT_ID = ""
GOOGLE_OAUTH2_CLIENT_SECRET = ""
# This is the field that is actually used
GOOGLE_OAUTH2_CLIENT_SECRET_FILEPATH = ""
GOOGLE_OAUTH2_CLIENT_SECRET_FILEPATH="/etc/secrets/pecha_auth.json" if os.getenv('isLocale') is None else "etc/secrets/pecha_auth.json"


GOOGLE_APPLICATION_CREDENTIALS = {
"type": "service_account",
Expand Down
18 changes: 16 additions & 2 deletions static/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ body.hebrew #talmudicPeoplePage #textTocLink {
border-left: 1px solid #aaa;
}
.browserNavItem {
font-family: 'jomolhari';
padding: 8px 4px 8px 10px;
cursor: pointer;
-webkit-transform: translateZ(0);
Expand Down Expand Up @@ -479,7 +480,7 @@ body.hebrew #talmudicPeoplePage #textTocLink {
}
#browserPreview .segment .he {
font-size: 130%;
font-family: "Taamey Frank", "adobe-garamond-pro", "Crimson Text", Georgia, "Times New Roman", serif;
font-family: "jomolhari";
text-align: left;
direction: ltr;
}
Expand Down Expand Up @@ -755,4 +756,17 @@ a:active {
}
.static label .int-he .sub{
margin-right: 4px;
}
}

.interface-hebrew > #staticContentWrapper > #content > #textBrowser > #browserPath > .browserPathItem {
font-family: 'wujin+gangbi';
}

.interface-hebrew > #staticContentWrapper > #content > #textBrowser > #browserNav > .browserNavItem {
font-family: 'wujin+gangbi';
}

.interface-hebrew > #staticContentWrapper > #content > #textBrowser > #browserPreview > #browserNav > .browserNavItem > .ui-icon {
font-family: 'wujin+gangbi';
}

9 changes: 5 additions & 4 deletions static/css/s2.css
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ body, .en, .int-en {
unicode-bidi: isolate;
}

.int-en.heInEn {
.int-en .heInEn {
direction: ltr;
}

Expand Down Expand Up @@ -416,7 +416,7 @@ Legacy Style Guide Font Hierarchy -- the below should be refactored away in favo
.systemText .int-he.enInHe {
--english-font: var(--english-sans-serif-font-family);
--hebrew-font: var(--hebrew-sans-serif-font-family);
/* font-family: "Roboto", "Helvetica Neue", "Helvetica", sans-serif; */
font-family: "jomolhari", "Roboto", "Helvetica Neue", "Helvetica", sans-serif;
font-size: 16px;
font-weight: normal;
color: #000;
Expand Down Expand Up @@ -6032,7 +6032,7 @@ body .ui-autocomplete.dictionary-toc-autocomplete .ui-menu-item a.ui-state-focus
} */
.toggleSet.aliyotTorah, .toggleSet.punctuationTalmud, .toggleSet .toggle-set-label {
--english-font: var(--english-sans-serif-font-family);
--hebrew-font: var(--english-sans-serif-font-family);
--hebrew-font: var(--hebrew-serif-font-family);
text-transform: uppercase;
}

Expand Down Expand Up @@ -12975,8 +12975,9 @@ section.SheetSource .SheetOutsideBiText {

.filterable-list input {
border: 0;
padding: 7px;
font-size: 18px;
font-family: "adobe-garamond-pro", "Crimson Text", Georgia, serif;
font-family: "jomolhari", "adobe-garamond-pro", "Crimson Text", Georgia, serif;
background-color: transparent;
}

Expand Down
4 changes: 4 additions & 0 deletions static/css/sheets.css
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,7 @@ body.hasBannerMessage .sheetsEditNavTop {
color: #333;
}
#sheet p {
font-family: "jomolhari" !important;
font-size: inherit;
line-height: inherit;
margin: inherit;
Expand Down Expand Up @@ -1571,6 +1572,9 @@ body.hasBannerMessage .sheetsEditNavTop {
border: 1px solid #999;
color: #333;
}
#sheet.hebrew .outsideWrapper .en{
font-family: 'jomolhari';
}
.addInterfaceButton:first-of-type {
/*border-left: 1px solid #cecece;*/
border-inline-start: 1px solid #cecece;
Expand Down
14 changes: 7 additions & 7 deletions static/js/AboutBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class AboutBox extends Component {
if (d) {
detailSection = (<div className="detailsSection">
<h2 className="aboutHeader">
<span className={`${Sefaria.languageClassFont()}`}>{ Sefaria._("About This Text")}</span>
<span className={`${Sefaria.languageClassFont()}`}>{ Sefaria._("side_nav.about_text")}</span>
</h2>
<div className="aboutTitle">
{d.title.stripHtml()}
Expand All @@ -100,9 +100,9 @@ class AboutBox extends Component {
const translationVersions = Object.entries(this.state.currentVersionsByActualLangs).filter(([lang, version]) => lang !== "he").map(([lang, version])=> version);
const multiple_translations = translationVersions?.length > 1;
const no_source_versions = multiple_translations || translationVersions?.length === 1 && !sourceVersion;
const sourceVersionSectionTitle = {en: Sefaria._("Current Version"), he:Sefaria._("Current Version")};
const translationVersionsSectionTitle = multiple_translations ? {en: Sefaria._("Current Translations"), he:Sefaria._("Current Translations")} : {en: Sefaria._("Current Translation"), he: Sefaria._("Current Translation")};
const alternateVersionsSectionTitle = no_source_versions ? {en: Sefaria._("Source Versions"), he: Sefaria._("Source Versions")} : {en: Sefaria._("Alternate Source Versions"), he: Sefaria._("Alternate Source Versions")}
const sourceVersionSectionTitle = {en: Sefaria._("text.current_version"), he:Sefaria._("text.current_version")};
const translationVersionsSectionTitle = multiple_translations ? {en: Sefaria._("text.current_translation"), he:Sefaria._("text.current_translation")} : {en: Sefaria._("text.current_translation"), he: Sefaria._("text.current_translation")};
const alternateVersionsSectionTitle = no_source_versions ? {en: Sefaria._("source_versions"), he: Sefaria._("source_versions")} : {en: Sefaria._("alt_source_versions"), he: Sefaria._("alt_source_versions")}

let detailSection = null;
if (d) {
Expand Down Expand Up @@ -137,7 +137,7 @@ class AboutBox extends Component {
detailSection = (
<div className="detailsSection sans-serif">
<h2 className="aboutHeader">
<InterfaceText>{ Sefaria._("About This Text")}</InterfaceText>
<InterfaceText>side_nav.about_text</InterfaceText>
</h2>
<a href={bookPageUrl} className="aboutTitle serif">
<ContentText text={{en: d.title, he:d.heTitle}}/>
Expand All @@ -163,8 +163,8 @@ class AboutBox extends Component {

{ !!placeTextEn || !!dateTextEn ?
<div className="aboutComposed">
<span className="en">{ Sefaria._("Composed")} {`${!!placeTextEn ? placeTextEn : ""} ${!!dateTextEn ? dateTextEn : ""}`}</span>
<span className="he">{ Sefaria._("Composed")} {`${!!placeTextHe ? placeTextHe : ""} ${!!dateTextHe ? dateTextHe : ""}`}</span>
<span className="en">{ Sefaria._("text.composed")} {`${!!placeTextEn ? placeTextEn : ""} ${!!dateTextEn ? dateTextEn : ""}`}</span>
<span className="he">{ Sefaria._("text.composed")} {`${!!placeTextHe ? placeTextHe : ""} ${!!dateTextHe ? dateTextHe : ""}`}</span>
</div> : null
}
</div>
Expand Down
35 changes: 17 additions & 18 deletions static/js/AboutSheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {
const newSummary = event.target.value
if (event.target.value.length > 280) {
setValidation({
validationMsg: Sefaria._("The summary description is limited to 280 characters."),
validationMsg: Sefaria._("summary_limit"),
validationFailed: "summary"
});
}
Expand Down Expand Up @@ -111,22 +111,22 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {
const isFormValidated = () => {
if ((!summary || summary.trim() == '') && tags.length == 0) {
setValidation({
validationMsg: Sefaria._("Please add a description and topics to publish your sheet."),
validationMsg: Sefaria._("topic.add_desription"),
validationFailed: "both"
});
return false
}
else if (!summary || summary.trim() == '') {
setValidation({
validationMsg: Sefaria._("Please add a description to publish your sheet."),
validationMsg: Sefaria._("sheet.add_description"),
validationFailed: "summary"
});
return false
}

else if (tags.length == 0) {
setValidation({
validationMsg: Sefaria._("Please add topics to publish your sheet."),
validationMsg: Sefaria._("topic.add_topic_to_sheet"),
validationFailed: "topics"
});
return false
Expand Down Expand Up @@ -206,7 +206,7 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {

{sheet.topics && sheet.topics.length > 0 ?
<div className="readings">
<h3 className="aboutSheetHeader"><InterfaceText>{ Sefaria._("Topics")}</InterfaceText></h3>
<h3 className="aboutSheetHeader"><InterfaceText>header.topic</InterfaceText></h3>
<div>
<ul className="aboutSheetLinks">
{sheet.topics.map((topic, i) => (
Expand All @@ -224,23 +224,23 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {
</div>;

const publishSettingsEditMode = <div className="publishSettingsEditMode"><div className={isPublished ? "publishBox transparentBackground sans-serif" : "publishBox sans-serif"}>
{!isPublished ? <p><InterfaceText> { Sefaria._("Publish your sheet on Sefaria for others to discover.")}</InterfaceText></p> : null}
<h3 className="aboutSheetHeader"><InterfaceText> { Sefaria._("Summary")}</InterfaceText></h3>
{!isPublished ? <p><InterfaceText>sheet.publish_sheet_on_pecha</InterfaceText></p> : null}
<h3 className="aboutSheetHeader"><InterfaceText>summary</InterfaceText></h3>
<textarea
className={validation.validationFailed === "both" || validation.validationFailed === "summary" ? "error" : ""}
rows="3"
maxLength="281"
placeholder={Sefaria._("Write a short description of your sheet...")}
placeholder={Sefaria._("write_short_description")}
value={summary} onChange={handleSummaryChange}></textarea>
<h3 className="aboutSheetHeader"><InterfaceText>Topics</InterfaceText></h3>
<h3 className="aboutSheetHeader"><InterfaceText>header.topic</InterfaceText></h3>
<div className={validation.validationFailed === "both" || validation.validationFailed === "topics" ? "error" : ""}>
<ReactTags
ref={reactTags}
allowNew={true}
tags={tags}
suggestions={suggestions}
onDelete={onTagDelete}
placeholderText={Sefaria._("Add a topic...")}
placeholderText={Sefaria._("add_topic")}
delimiters={["Enter", "Tab", ","]}
onAddition={onTagAddition}
onValidate={onTagValidate}
Expand All @@ -251,7 +251,7 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {

{!isPublished ? <div className={"publishButton"}>
<button className="button notPublished" onClick={togglePublish}>
<InterfaceText>{ Sefaria._("Publish")} </InterfaceText>
<InterfaceText>publish</InterfaceText>
</button>
</div> : null}

Expand All @@ -261,12 +261,11 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {
<div className={"publishButton"}>
<div className="publishedText">
<InterfaceText>
<EnglishText>{Sefaria._("Your Sheet is")}<span className="publishedTextBold">{ Sefaria._("published")} </span> { Sefaria._("on Sefaria and visible to others through search and topics.")} </EnglishText>
<HebrewText>{Sefaria._("Your Sheet is")} <span className="publishedTextBold">{ Sefaria._("published")}</span> { Sefaria._("on Sefaria and visible to others through search and topics.")}</HebrewText>
{Sefaria._("sheet.your_sheet_is")}<span className="publishedTextBold">{ Sefaria._("published")} </span> { Sefaria._("topic.visible_to_other")}
</InterfaceText>
</div>
<button className="button published" onClick={togglePublish}>
<InterfaceText>{Sefaria._("Unpublish")}</InterfaceText>
<InterfaceText>unpublish</InterfaceText>
</button>
</div>
: null
Expand Down Expand Up @@ -295,10 +294,10 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {
<div className="aboutSheetMetadata">
<div>
<span>{Sefaria.util.localeDate(sheet.dateCreated)}</span>
<span>{sheet.views} {Sefaria._("Views")}</span>
<span>{sheet.views} {Sefaria._("profile.tab.sheet.tag.views")}</span>
<span>{sheetSaves.length} {Sefaria._("Saves")}</span>
</div>
{/* {sheet.status !== 'public' ? (<div><span className="unlisted"><img src="/static/img/eye-slash.svg"/><span>{Sefaria._("Not Published")}</span></span></div>) : undefined} */}
{/* {sheet.status !== 'public' ? (<div><span className="unlisted"><img src="/static/img/eye-slash.svg"/><span>{Sefaria._("profile.tab.sheet.tag.not_published")}</span></span></div>) : undefined} */}
</div>
{
canEdit ? publishSettingsEditMode : publishSettingsReadOnly
Expand Down Expand Up @@ -417,14 +416,14 @@ const CollectionsEditor = ({ sheetId }) => {
{dataLoaded && collections.length === 0 ?
<span className={"emptyMessage"}>
<InterfaceText>
{Sefaria._("You can use collections to organize your sheets or public sheets you like. Collections can shared privately or made public on Sefaria.")}
{Sefaria._("profile.collection_description")}
</InterfaceText>
</span> : null}
</div>
<div className="collectionsEditorCreate">
<span className="collectionsWidgetPlus">+</span>
<div className="collectionsWidgetCreateInputBox">
<input className="collectionsWidgetCreateInput" placeholder={Sefaria._("Create new collection")} value={newName} onChange={onNameChange} />
<input className="collectionsWidgetCreateInput" placeholder={Sefaria._("collection.create_new_collection")} value={newName} onChange={onNameChange} />
</div>
{newName.length ?
<div className="button extraSmall white collectionsWidgetCreateButton" onClick={onCreateClick}>
Expand Down
Loading

0 comments on commit 1dfb334

Please sign in to comment.