From 66647a57dbbfd396f33704e930f8c457e173ccfc Mon Sep 17 00:00:00 2001 From: Yishai Date: Mon, 14 Mar 2022 12:20:57 +0200 Subject: [PATCH 1/3] manuscrips sources to view only domain --- static/js/ConnectionsPanel.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/ConnectionsPanel.jsx b/static/js/ConnectionsPanel.jsx index a9b5133175..1991273729 100644 --- a/static/js/ConnectionsPanel.jsx +++ b/static/js/ConnectionsPanel.jsx @@ -1822,7 +1822,9 @@ function ManuscriptImage(props) { : '' } - {manuscript.manuscript['source'].replace("https://", "")} + + { Sefaria.util.parseUrl(manuscript.manuscript['source']).host.replace("www.", "") } + From 364ab252c834d1e908df1d54273f21a450569a7b Mon Sep 17 00:00:00 2001 From: Yishai Date: Wed, 16 Mar 2022 12:43:10 +0200 Subject: [PATCH 2/3] enables manuscript license --- sefaria/model/manuscript.py | 1 + static/js/ConnectionsPanel.jsx | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/sefaria/model/manuscript.py b/sefaria/model/manuscript.py index 9b1fe2b6a4..607608a87d 100644 --- a/sefaria/model/manuscript.py +++ b/sefaria/model/manuscript.py @@ -25,6 +25,7 @@ class Manuscript(AbstractMongoRecord): 'description', 'he_description' ] + optional_attrs = ['license'] def normalize_slug_field(self, slug_field: str) -> str: """ diff --git a/static/js/ConnectionsPanel.jsx b/static/js/ConnectionsPanel.jsx index 1991273729..ae8cfe7106 100644 --- a/static/js/ConnectionsPanel.jsx +++ b/static/js/ConnectionsPanel.jsx @@ -1821,6 +1821,16 @@ function ManuscriptImage(props) { : '' } + { + manuscript.manuscript['license'] + ?
+ + + {manuscript.manuscript['license']} + +
+ : '' + } { Sefaria.util.parseUrl(manuscript.manuscript['source']).host.replace("www.", "") } From 4a3f3dff3e75fee03c5ba1db43beb54f04d86dde Mon Sep 17 00:00:00 2001 From: Yishai Date: Wed, 16 Mar 2022 14:54:37 +0200 Subject: [PATCH 3/3] review --- static/js/ConnectionsPanel.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/static/js/ConnectionsPanel.jsx b/static/js/ConnectionsPanel.jsx index ae8cfe7106..a8f09aef94 100644 --- a/static/js/ConnectionsPanel.jsx +++ b/static/js/ConnectionsPanel.jsx @@ -1824,10 +1824,11 @@ function ManuscriptImage(props) { { manuscript.manuscript['license'] ?
- - - {manuscript.manuscript['license']} - + License + : + + {Sefaria._(manuscript.manuscript['license'])} +
: '' }