|
|
Zeile 1: |
Zeile 1: |
| <includeonly>
| | <div class="sprachen"> |
| <div class="autorenbox zum-hintergrund-links zum-farbe-xx-heller uk-hidden"> | | {{Portalseite/Titel |
| <h2>Autor*innen</h2>
| | |titel=Deutsch |
| <small class="autorenbox-updated" data-zum-hook="last-modified">aktualisiert am: </small>
| | |icon=hdg-languages |
| <div class="autorenbox-autoren" data-zum-hook="userlist"> | | }} |
| | <!-- |
| | {{3Spalten| |
|
| |
|
| | {{Portalseite/Spotlight |
| | | link = |
| | | iconfile = |
| | | titel = |
| | | teaser = |
| | }} |
| | | |
| | {{Portalseite/Spotlight |
| | | link = |
| | | iconfile = |
| | | titel = |
| | | teaser = |
| | }} |
| | }} |
| | --> |
| | {{2Spalten| |
| | == <span class="brainy hdg-star"></span> Zum Reinschauen == |
| | |
| | <!-- |
| | {{Portalseite/Highlight |
| | | iconfile = Zumpad-Icon.svg |
| | | link = Reisen |
| | | titel = Reisen & Literatur |
| | }} |
| | {{Portalseite/Highlight |
| | | iconfile = Mitmachen-Icon.svg |
| | | link = Rhetorik |
| | | titel = Reden planen und halten |
| | }} |
| | {{Portalseite/Highlight |
| | | iconfile = Schueler-Icon.svg |
| | | link = Kooperatives Lernen |
| | | titel = Kooperatives Lernen |
| | }} |
| | --> |
| | [[Lese- und Literaturquizze|<span class="fa-3x brainy hdg-question"></span> Lese- und Literaturquizze]] |
| | |
| | {{Portalseite/Highlight |
| | | iconfile = Buch-Icon.svg |
| | | link = Schreibaufgaben |
| | | titel = Schreibanlässe und Textformen |
| | }} |
| | |
| | [[Rhetorik|<span class="fa-3x brainy hdg-spech-bubbles></span> Reden planen und halten]] |
| | |
| | | |
| | |
| | {{Portalseite/BlockSuche|kategorie=Deutsch}} |
| | |
| | {{Portalseite/BlockThemenliste|kategorie=Deutsch}} |
| | }} |
| </div> | | </div> |
| | ==Themen== |
| | <div class="grid"> |
| | <div class="width-1-2"> |
| | <!-- |
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Kinder- und Jugendliteratur}} |
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Schreiben}} |
| | --> |
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Rechtschreibung}} |
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Grammatik}} |
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Textsorten}} |
| </div> | | </div> |
| <script type="text/javascript"> | | <div class="width-1-2"> |
| (function () {
| | <!-- |
| const paramArtikel = "<!--{$artikel|escape:'javascript'}-->" || null;
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Texte}} |
| const paramKategorie = "<!--{$kategorie|escape:'javascript'}-->" || null;
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Reisen}} |
| const paramMitUnterseiten = "<!--{$mit_unterseiten|escape:'javascript'}-->" === "ja";
| | --> |
| const element = document.currentScript && document.currentScript.previousElementSibling;
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Lyrik}} |
| if (element) {
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Wortschatz}} |
| window.RLQ.push(function () {
| | {{Portalseite/Großthema|Unterrichtsfach=Deutsch|Großthema=Epochen der deutschen Literatur|Titel=Literaturgeschichte}} |
| mw.loader.enqueue(['mediawiki.api'], function () {
| | </div> |
| const getCurrentTitle = () => mw.Title.makeTitle(
| | </div> |
| mw.config.get('wgNamespaceNumber'),
| | |
| mw.config.get('wgTitle')
| | |
| ).getPrefixedText()
| | [[Kategorie:Deutsch]] |
| ;
| | [[Kategorie:Portalseite]] |
| const userlistEl = $(element).find('[data-zum-hook="userlist"]');
| |
| const lastModifiedEl = $(element).find('[data-zum-hook="last-modified"]');
| |
| const api = new mw.Api();
| |
| const queries = [];
| |
| if (paramKategorie) {
| |
| queries.push({
| |
| action: 'query',
| |
| prop: ['contributors', 'info'],
| |
| generator: 'categorymembers',
| |
| gcmtitle: `Kategorie:${paramKategorie}`,
| |
| gcmnamespace: 0,
| |
| gcmtype: 'page',
| |
| gcmlimit: 'max'
| |
| });
| |
| } else {
| |
| queries.push({
| |
| action: 'query',
| |
| prop: ['revisions', 'info', 'contributors'],
| |
| titles: paramArtikel || getCurrentTitle(),
| |
| rvlimit: 150,
| |
| rvprop: ['userid', 'user', 'flags', 'timestamp'],
| |
| });
| |
| }
| |
| if (paramMitUnterseiten){
| |
| queries.push({
| |
| action: 'query',
| |
| prop: ['contributors', 'info'],
| |
| generator: 'allpages',
| |
| gapprefix: (paramArtikel || getCurrentTitle()) + '/',
| |
| gaplimit:'max'
| |
| });
| |
| }
| |
| const response = $.Deferred();
| |
| function continueQueryOrResolve(result, query, pages, lastContinue) {
| |
| api.get({...query, ...lastContinue})
| |
| .then((response) => {
| |
| const newPages = Object.values(response.query.pages).reduce((pages, page) => {
| |
| pages[page.pageid] = {...pages[page.pageid], ...page};
| |
| return pages;
| |
| }, pages);
| |
| if (response.continue !== undefined) {
| |
| continueQueryOrResolve(result, query, newPages, response.continue);
| |
| } else if (response.batchcomplete !== undefined) {
| |
| result.resolve(Object.values(newPages));
| |
| }
| |
| });
| |
| }
| |
| const def = $.Deferred();
| |
| def.resolve([]);
| |
| queries.reduce((result, query) => {
| |
| const newResult = $.Deferred();
| |
| continueQueryOrResolve(newResult, query, {}, null);
| |
| return newResult.then((b) => {
| |
| return result.then((a) => ([...a, ...b]));
| |
| });
| |
| }, def.promise())
| |
| .then((data) => { response.resolve(data);});
| |
|
| |
| response
| |
| .then((pages) => {
| |
| const userCounts = pages.reduce((acc, pageData) => {
| |
| acc.touched = Math.max(acc.touched || -1, Date.parse(pageData.touched));
| |
| acc.userChanges = (pageData.contributors || [])
| |
| .reduce((userChanges, c) => {
| |
| userChanges[c.userid] = userChanges[c.userid] || {
| |
| count: 0,
| |
| last: -1,
| |
| userid: c.userid,
| |
| username: c.name
| |
| };
| |
| userChanges[c.userid].count += 1;
| |
| return userChanges;
| |
| }, acc.userChanges || {});
| |
| acc.userChanges = (pageData.revisions || [])
| |
| .reduce((userChanges, r) => {
| |
| userChanges[r.userid] = userChanges[r.userid] || {
| |
| count: 0,
| |
| last: -1,
| |
| userid: r.userid,
| |
| username: r.user
| |
| };
| |
| userChanges[r.userid].count += r.minor !== undefined ? 0.1 : 1;
| |
| userChanges[r.userid].last = Math.max(userChanges[r.userid].last, r.revid);
| |
| return userChanges;
| |
| }, acc.userChanges || {});
| |
| return acc;
| |
| }, {});
| |
| const usernames = Object.values(userCounts.userChanges)
| |
| .filter((userChange) => userChange.username !== 'Christian')
| |
| .sort((a, b) => {
| |
| let diff = b.count - a.count;
| |
| if (diff !== 0) {
| |
| return diff;
| |
| }
| |
| return b.last - a.last;
| |
| }).map((user) => user.username);
| |
| $(lastModifiedEl).append(new Date(userCounts.touched).toLocaleDateString());
| |
| const userdatas = usernames.map((user) => api
| |
| .parse(`{{#avatar:${user}|l}}`)
| |
| .then((imgTag) => $(imgTag))
| |
| .then((img$) => img$.find('img').addBack('img').attr('src'))
| |
| .then((imgSrc) => ({user, imgSrc}))
| |
| .fail((ignored) => null)
| |
| );
| |
| $.when(...userdatas)
| |
| .then((...userdatas) => userdatas.filter((ud) => ud !== null))
| |
| .then((userdatas) => {
| |
| userdatas.map(({user, imgSrc}) => {
| |
| const userTitle = mw.Title.makeTitle(mw.config.get('wgNamespaceIds')['benutzer'], user);
| |
| if(userTitle === null){
| |
| return null;
| |
| }
| |
| return $('<img>')
| |
| .attr('src', imgSrc)
| |
| .wrap('<a>')
| |
| .parent()
| |
| .attr('href', userTitle.getUrl())
| |
| .wrap('<div class="autorenbox-avatar" style="overflow:hidden;width:60%;margin:auto;">')
| |
| .parent()
| |
| .wrap('<div class="autorenbox-container" style="max-width:12ch">')
| |
| .parent()
| |
| .append(
| |
| $('<a>')
| |
| .append(user)
| |
| .attr('href', userTitle.getUrl())
| |
| .wrap('<div class="autorenbox-name">')
| |
| .parent()
| |
| );
| |
| })
| |
| .filter((elem) => elem !== null)
| |
| .forEach((elem) => elem.appendTo($(userlistEl)));
| |
| })
| |
| .then((ignored) => $(element).removeClass('uk-hidden'));
| |
| });//end response.then
| |
| });//end loader.enqueue
| |
| });//end RLQ.push
| |
| }//end if
| |
| })();
| |
| </script>
| |
| </includeonly>
| |