Skip to content

Commit

Permalink
Merge pull request #3398 from serlo/staging
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
elbotho authored Feb 16, 2024
2 parents 51c2cbd + 0c31de5 commit 459ec7e
Show file tree
Hide file tree
Showing 17 changed files with 220 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ export function ExerciseLicenseNotice({
strings.license.appliesTo
}: ${typeString})`

const tooltipExplanation = isCreativeCommons
? explanation
: `${explanation} –– ${strings.license.nonFree}`
const tooltipExplanation =
isCreativeCommons || explanation.includes('---')
? explanation
: `${explanation} --- ${strings.license.nonFree}`

return (
<>
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/data/de/license-data-short.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,12 @@ export const licenses: LicenseData[] = [

agreement: `Mit dem Speichern dieser Seite versichere ich, dass ich die Veränderung des Inhalts selbst verfasst habe bzw. dass meine Änderungen keine fremden Rechte verletzen. Ich willige ein, meinen Beitrag unter der <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de">Creative Commons Attribution/Share-Alike Lizenz 4.0</a> und/oder unter einer gleichwertigen Lizenz zu veröffentlichen, welche der Serlo Education e. V. entsprechend der Regelungen in den <a href="/terms">Nutzungsbedingungen</a> festlegen darf. Let's go 🤘`,
},
{
id: 26,
title:
'Dieses Werk wurde vom Kultusministerium Niedersachsen zur Verfügung gestellt --- Die Lösungsvorschläge dagegen sind NICHT vom Land Niedersachsen.',
shortTitle: 'Niedersächsisches Kultusministerium',
url: 'https://aba-aufgaben.nibis.de',
agreement: `Mit dem Speichern dieser Seite versicherst du, dass du in deinem Beitrag (damit sind auch Änderungen gemeint) die Aufgabenstellung vom Land Niedersachsen nicht inhaltlich verändert hast, keine Rechte Dritter verletzt und dich an die <a href="https://aba-aufgaben.nibis.de/">Nutzungsbedingungen</a> gehalten hast.`,
},
]
5 changes: 5 additions & 0 deletions apps/web/src/data/licenses/licenses-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export const licensesContent = [
content:
'{"plugin":"rows","state":[{"plugin":"text","state":[{"type":"p","children":[{"text":"Dieser Inhalt wurde vom "},{"type":"a","href":"https://chancenwerk.de/","children":[{"text":"Chancenwerk"}]},{"text":" erstellt und ggf in Zusammenarbeit mit Serlo Autor*innen weiterentwickelt. Der Chancenwerk e.V. hält das Urheberrecht an diesem Inhalt. Serlo dankt für die freundliche Genehmigung zur Veröffentlichung."}]},{"type":"p","children":[{"text":"Der Lerninhalt steht unter der "},{"text":"Lizenz CC BY SA 4.0.","strong":true},{"text":"Du darfst das Werk kopieren, vervielfältigen, bearbeiten und weiterentwickeln. Dies gilt unter folgenden Bedingungen:"}]},{"type":"h","level":3,"children":[{"text":"Wenn du "},{"text":"keine","strong":true},{"text":" Veränderungen vornimmst:"}]},{"type":"unordered-list","children":[{"type":"list-item","children":[{"type":"list-item-child","children":[{"text":"Du musst Serlo und das Chancenwerk als Quelle nennen \\"Quelle: serlo.org & Chancenwerk\\", in digitaler Form als Link direkt zu diesem Inhalt."}]}]},{"type":"list-item","children":[{"type":"list-item-child","children":[{"text":"Du musst die Lizenz angeben \\"Lizenz: CC BY SA 4.0\\", in digitaler Form als Link zu dieser Seite: "},{"type":"a","href":"https://creativecommons.org/licenses/by-sa/4.0/deed.de","children":[{"text":"https://creativecommons.org/licenses/by-sa/4.0/deed.de"}]},{"text":"."}]}]}]},{"type":"h","level":3,"children":[{"text":"Wenn du Veränderungen vornimmst:"}]},{"type":"unordered-list","children":[{"type":"list-item","children":[{"type":"list-item-child","children":[{"text":"Du musst Serlo und das Chancenwerk als Quelle nennen \\"Quelle: serlo.org & Chancenwerk\\", in digitaler Form als Link direkt zu diesem Inhalt."}]}]},{"type":"list-item","children":[{"type":"list-item-child","children":[{"text":"Du musst kurz erläutern, welche Änderungen du vorgenommen hast, z.B. \\"Zahlen vereinfacht\\" oder \\"Bild zugeschnitten\\"."}]}]},{"type":"list-item","children":[{"type":"list-item-child","children":[{"text":"Du musst die Lizenz \\"CC BY SA 4.0\\" angeben, in digitaler Form als Link zu dieser Seite: "},{"type":"a","href":"https://creativecommons.org/licenses/by-sa/4.0/deed.de","children":[{"text":"https://creativecommons.org/licenses/by-a/4.0/deed.de"}]},{"text":". Die Lizenz muss für das gesamte Werk angegeben werden, zu dem dieser Inhalt beigetragen hat."}]}]}]}]}]}',
},
{
id: 26,
content:
'{"plugin":"rows","state":[{"plugin":"text","state":[{"type":"p","children":[{"text":"Für diese "},{"text":"Aufgabenstellungen","strong":true},{"text":" der Abschlussarbeiten gelten die "},{"type":"a","href":"https://aba-aufgaben.nibis.de/","children":[{"text":"Nutzungsbedingungen des Niedersächsischen Kultusministeriums"}]},{"text":" (siehe auch unten)."}]},{"type":"p","children":[{"text":""}]},{"type":"p","children":[{"text":"Wichtig:","strong":true},{"text":" Bei den "},{"text":"Lösungsvorschlägen","strong":true},{"text":" dazu handelt es sich "},{"text":"explizit nicht","strong":true},{"text":" um Lösungsvorgaben des Landes Niedersachsens. Diese sind von Autor*innen auf serlo.org erstellt oder kommen aus anderen Quellen."}]},{"type":"h","children":[{"text":""}],"level":3}],"id":"1d0f5fb6-7d86-4847-9829-7c389fd86bb0"},{"plugin":"box","state":{"type":"quote","title":{"plugin":"text","state":[{"type":"p","children":[{"text":"Nutzungsbedingungen vom Niedersächsischen Kultusministerium"}]}],"id":"3ab2c124-20a9-4ca5-afe6-9cbe7d01f7cc"},"anchorId":"","content":{"plugin":"rows","state":[{"plugin":"text","state":[{"type":"p","children":[{"text":"Es wird darauf hingewiesen, dass die hier bereitgestellten Werke des Niedersächsischen Kultusministeriums zur freien Verwendung unentgeltlich zur Verfügung gestellt werden. Aufgabenstellungen und Lösungsvorgaben dürfen nur veröffentlicht werden, wenn die zur Verfügung gestellten Fassungen inhaltlich nicht verändert werden und bei der Veröffentlichung eine Quellenangabe erfolgt. Selbst erstellte Lösungen sind mit dem Hinweis zu versehen, dass es sich dabei nicht um Lösungsvorgaben des Landes Niedersachsen handelt. Die zur Verfügung gestellten Unterlagen enthalten aus urheberrechtlichen Gründen keinerlei Texte, Abbildungen oder andere Werke anderer Urheber*innen, sondern verweisen lediglich auf diese. Nutzer*innen verpflichten sich, hinsichtlich solcher Werke die geltenden urheberrechtlichen Bestimmungen zu beachten und vor einer Verwendung dieser Quellen von den jeweiligen Urheber*innen die erforderlichen Nutzungs- und Verwertungsrechte einzuholen."}]},{"type":"p","children":[{"text":""}]},{"type":"p","children":[{"text":"Stand: 15.02.2024 ("},{"type":"a","href":"https://aba-aufgaben.nibis.de/","children":[{"text":"Quelle"}]},{"text":")"}]}],"id":"0c0ab6e8-9b97-45ec-9db4-60fd7cb24046"}],"id":"051eaece-d731-4022-8eae-13269beb9a56"}},"id":"7e25bb34-e257-4bca-b03b-ccb77d7890c7"}]}',
},
{
id: 9,
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const CommentAreaEntity = dynamic<CommentAreaEntityProps>(() =>
)
)

// Special version for serlo.org with author tools, comments and license
// Special version for serlo.org with author tools and comments
export function SolutionSerloStaticRenderer(props: EditorSolutionDocument) {
const { asPath } = useRouter()
const ab = useAB()
Expand Down
47 changes: 22 additions & 25 deletions packages/editor/src/plugins/audio/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,29 @@ export const AudioToolbar = ({
>
{audioStrings.audioUrl} <FaIcon icon={faPencilAlt} />
</button>
{/* In the future we want a popovers per setting, but this is faster for now */}
{showSettingsModal ? (
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">{audioStrings.title}</h3>
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">{audioStrings.title}</h3>

<div className="mx-side mb-3">
<EditorInput
autoFocus
label={`${audioStrings.audioUrl}: `}
value={state.src.value}
onChange={(e) => {
state.src.set(e.target.value)
}}
inputWidth="100%"
width="100%"
onKeyDown={handleInputEnter}
placeholder="voca.ro/audio-id"
className="block"
/>
</div>
</ModalWithCloseButton>
) : null}
<div className="mx-side mb-3">
<EditorInput
autoFocus
label={`${audioStrings.audioUrl}: `}
value={state.src.value}
onChange={(e) => {
state.src.set(e.target.value)
}}
inputWidth="100%"
width="100%"
onKeyDown={handleInputEnter}
placeholder="voca.ro/audio-id"
className="block"
/>
</div>
</ModalWithCloseButton>
</>
}
pluginControls={<PluginDefaultTools pluginId={id} />}
Expand Down
45 changes: 21 additions & 24 deletions packages/editor/src/plugins/geogebra/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,28 @@ export const GeogebraToolbar = ({
>
{geogebraStrings.chooseApplet} <FaIcon icon={faPencilAlt} />
</button>
{/* In the future we want a popovers per setting, but this is faster for now */}
{showSettingsModal ? (
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">
{editorStrings.edtrIo.settings}: {geogebraStrings.title}
</h3>
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">
{editorStrings.edtrIo.settings}: {geogebraStrings.title}
</h3>

<div className="mx-side mb-3">
<EditorInput
autoFocus
label={`${geogebraStrings.urlOrId}: `}
placeholder="z.B. N5ktHvtW"
value={state.value}
onChange={(e) => state.set(e.target.value)}
inputWidth="100%"
width="100%"
className="block"
/>
</div>
</ModalWithCloseButton>
) : null}
<div className="mx-side mb-3">
<EditorInput
autoFocus
label={`${geogebraStrings.urlOrId}: `}
placeholder="z.B. N5ktHvtW"
value={state.value}
onChange={(e) => state.set(e.target.value)}
inputWidth="100%"
width="100%"
className="block"
/>
</div>
</ModalWithCloseButton>
</>
}
pluginControls={<PluginDefaultTools pluginId={id} />}
Expand Down
26 changes: 12 additions & 14 deletions packages/editor/src/plugins/image/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,19 @@ export const ImageToolbar = (
>
{editorStrings.edtrIo.settings} <FaIcon icon={faCog} />
</button>
{showSettingsModal ? (
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">
{editorStrings.edtrIo.settings}: {imageStrings.title}
</h3>
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">
{editorStrings.edtrIo.settings}: {imageStrings.title}
</h3>

<div className="mx-side mb-3">
<SettingsModalControls state={props.state} />
</div>
</ModalWithCloseButton>
) : null}
<div className="mx-side mb-3">
<SettingsModalControls state={props.state} />
</div>
</ModalWithCloseButton>

<UploadButton {...props} />
</>
Expand Down
49 changes: 23 additions & 26 deletions packages/editor/src/plugins/injection/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,30 @@ export const InjectionToolbar = ({
>
{injectionStrings.serloId} <FaIcon icon={faPencilAlt} />
</button>
{/* In the future we want a popovers per setting, but this is faster for now */}
{showSettingsModal ? (
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">{injectionStrings.title}</h3>
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">{injectionStrings.title}</h3>

<div className="mx-side mb-3">
<EditorInput
autoFocus
label={`${injectionStrings.serloId}: `}
placeholder={injectionStrings.placeholder}
inputMode="numeric"
pattern="\d+"
value={state.value}
onChange={(e) =>
state.set(e.target.value.replace(/[^0-9]/g, ''))
}
width="100%"
inputWidth="100%"
className="block"
/>
</div>
</ModalWithCloseButton>
) : null}
<div className="mx-side mb-3">
<EditorInput
autoFocus
label={`${injectionStrings.serloId}: `}
placeholder={injectionStrings.placeholder}
inputMode="numeric"
pattern="\d+"
value={state.value}
onChange={(e) =>
state.set(e.target.value.replace(/[^0-9]/g, ''))
}
width="100%"
inputWidth="100%"
className="block"
/>
</div>
</ModalWithCloseButton>
</>
}
pluginControls={<PluginDefaultTools pluginId={id} />}
Expand Down
24 changes: 11 additions & 13 deletions packages/editor/src/plugins/multimedia/toolbar/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ export const MultimediaToolbar = ({ id, children }: MultimediaToolbarProps) => {
>
{editorStrings.edtrIo.settings} <FaIcon icon={faCog} />
</button>
{showSettingsModal ? (
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">
{editorStrings.edtrIo.settings}:{' '}
{editorStrings.plugins.multimedia.title}
</h3>
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<h3 className="serlo-h3 mt-4">
{editorStrings.edtrIo.settings}:{' '}
{editorStrings.plugins.multimedia.title}
</h3>

<div className="mx-side mb-3">{children}</div>
</ModalWithCloseButton>
) : null}
<div className="mx-side mb-3">{children}</div>
</ModalWithCloseButton>
</>
}
pluginControls={<PluginDefaultTools pluginId={id} />}
Expand Down
16 changes: 7 additions & 9 deletions packages/editor/src/plugins/page-layout/toolbar/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ export const PageLayoutToolbar = ({
>
{pageLayoutStrings.chooseRatio} <FaIcon icon={faPencilAlt} />
</button>
{showSettingsModal ? (
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<LayoutChooser {...state} />
</ModalWithCloseButton>
) : null}
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<LayoutChooser {...state} />
</ModalWithCloseButton>
</>
}
/>
Expand Down
36 changes: 17 additions & 19 deletions packages/editor/src/plugins/serlo-template-plugins/applet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,23 @@ function AppletTypeEditor(props: EditorPluginProps<AppletTypePluginState>) {
{content.render()}

<ToolbarMain showSubscriptionOptions {...props.state} />
{showSettingsModal ? (
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<div className="mx-side mb-3 mt-12">
<SettingsTextarea
autoFocus
label={appletStrings.seoTitle}
state={meta_title}
/>
<SettingsTextarea
label={appletStrings.seoDesc}
state={meta_description}
/>
</div>
</ModalWithCloseButton>
) : null}
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<div className="mx-side mb-3 mt-12">
<SettingsTextarea
autoFocus
label={appletStrings.seoTitle}
state={meta_title}
/>
<SettingsTextarea
label={appletStrings.seoDesc}
state={meta_description}
/>
</div>
</ModalWithCloseButton>
</>
)
}
36 changes: 17 additions & 19 deletions packages/editor/src/plugins/serlo-template-plugins/article.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,23 @@ function ArticleTypeEditor(props: EditorPluginProps<ArticleTypePluginState>) {
<section itemProp="articleBody">{content.render()}</section>

<ToolbarMain showSubscriptionOptions {...props.state} />
{showSettingsModal ? (
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<div className="mx-side mb-3 mt-12">
<SettingsTextarea
label={articleStrings.seoTitle}
state={meta_title}
autoFocus
/>
<SettingsTextarea
label={articleStrings.seoDesc}
state={meta_description}
/>
</div>
</ModalWithCloseButton>
) : null}
<ModalWithCloseButton
isOpen={showSettingsModal}
onCloseClick={() => setShowSettingsModal(false)}
className="top-8 max-w-xl translate-y-0 sm:top-1/3"
>
<div className="mx-side mb-3 mt-12">
<SettingsTextarea
label={articleStrings.seoTitle}
state={meta_title}
autoFocus
/>
<SettingsTextarea
label={articleStrings.seoDesc}
state={meta_description}
/>
</div>
</ModalWithCloseButton>
</>
)
}
Loading

0 comments on commit 459ec7e

Please sign in to comment.