Skip to content

Commit

Permalink
Merge branch 'Sefaria:master' into production-master
Browse files Browse the repository at this point in the history
  • Loading branch information
Lungsangg authored Jan 23, 2024
2 parents 6cbe41b + bbb950b commit 3c8f633
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sefaria/model/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def traverse_tree(self, callback, **kwargs):
"""
callback(self, **kwargs)
for child in self.children:
child.traverse_to_string(callback, **kwargs)
child.traverse_tree(callback, **kwargs)

def traverse_to_string(self, callback, depth=0, **kwargs):
st = callback(self, depth, **kwargs)
Expand Down
3 changes: 3 additions & 0 deletions sefaria/model/topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ def set_slug(self, new_slug) -> None:

def merge(self, other: Union['Topic', str]) -> None:
"""
Merge `other` into `self`. This means that all data from `other` will be merged into self.
Data from self takes precedence in the event of conflict.
Links to `other` will be changed to point to `self` and `other` will be deleted.
:param other: Topic or old slug to migrate from
:return: None
"""
Expand Down
10 changes: 6 additions & 4 deletions static/js/AdminEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ const options_for_form = {
label: "English Description",
field: "enDescription",
placeholder: "Add a description.",
type: 'textarea'
type: 'textarea',
markdown: true,
},
"Hebrew Description": {
label: "Hebrew Description",
field: "heDescription",
placeholder: "Add a description.",
type: 'textarea'
type: 'textarea',
markdown: true
},
"Prompt": {label: "Prompt", field: "prompt", placeholder: "Add a prompt.", textarea: true},
"Prompt": {label: "Prompt", field: "prompt", placeholder: "Add a prompt.", type: 'textarea'},
"English Short Description": {
label: "English Short Description for Table of Contents", field: "enCategoryDescription",
placeholder: "Add a short description.", type: 'input'
Expand Down Expand Up @@ -136,7 +138,7 @@ const AdminEditor = ({title, data, close, catMenu, pictureUploader, updateData,
const preprocess = async () => {
setValidatingLinks(true);
for (const x of items) {
if (options_for_form[x]?.is_textarea) {
if (options_for_form[x]?.markdown) {
const field = options_for_form[x].field;
const valid_tags = await validateMarkdownLinks(data[field]);
if (!valid_tags) {
Expand Down

0 comments on commit 3c8f633

Please sign in to comment.