Template:subpagesSummary

  • Revision slug: Template:subpagesSummary
  • Revision title: Template:subpagesSummary
  • Revision id: 68900
  • Created:
  • Creator: trevorh
  • Is current revision? No
  • Comment Reverted to earlier version; 50 words added, 12 words removed

Revision Content

/* get the page language */
var u = uri.parts(Page.uri);
var lang = string.tolower(u.path[0]);
if (string.contains(lang, "project")) {
  lang = string.substr(lang, 8);
}
/* fall back to page.language on a user page */
else if (string.StartsWith(lang, "user:")) {
 lang = page.language;
}

var description = "Description";
var summary = "Summary";

switch(lang) {
  case 'fr':
    description = "Description";
    summary = "Résumé";
    break;
}

;
var type1 = "";
if ($1)
  type1 = typeof $1;
foreach (var i in list.orderBy(map.keyValues(page.subpages), "key"))
  ;
$0"(description)"
if ($1) switch (type1){ case "bool": i.value.title; break; case "list": var s = i.value.title; if (!list.contains($1, s)) s; else s; break; } else i.value.title; var s2 = xml.text(wiki.page(i.value.path, summary), "//p", _, true); web.html(string.substr(s2, 3, #s2 - 7));
;

Revision Source

<pre class="script">
/* get the page language */
var u = uri.parts(Page.uri);
var lang = string.tolower(u.path[0]);
if (string.contains(lang, "project")) {
  lang = string.substr(lang, 8);
}
/* fall back to page.language on a user page */
else if (string.StartsWith(lang, "user:")) {
 lang = page.language;
}

var description = "Description";
var summary = "Summary";

switch(lang) {
  case 'fr':
    description = "Description";
    summary = "Résumé";
    break;
}

<table class="standard-table">
  <thead>
    <tr><th scope="col">$0</th><th scope="col">"(description)"</th></tr>
  </thead>;
var type1 = "";
if ($1)
  type1 = typeof $1;
foreach (var i in list.orderBy(map.keyValues(page.subpages), "key"))
  <tr>
    <td><a href=(i.value.uri) rel="internal" style="white-space: nowrap;">
      if ($1)
        switch (type1){
          case "bool":
            i.value.title;
            break;
          case "list":
            var s = i.value.title;
            if (!list.contains($1, s))
              <code>s</code>;
            else
              s;
            break;
        }
      else
        <code>i.value.title</code>;
    </a></td>
    <td>
      var s2 = xml.text(wiki.page(i.value.path, summary), "//p", _, true);
      web.html(string.substr(s2, 3, #s2 - 7));
    </td>
  </tr>;
</table>;
</pre>
Revert to this revision