Debug.rythm

From BITPlan Wiki
Revision as of 16:32, 29 October 2017 by Wf (talk | contribs)
Jump to navigation Jump to search

Links

Source

@// Rythm template for the WikiCMS approach
@args() {
  String content,
  String lang,
  String title,
  Map<String,Object> smwprops; 
}
<!doctype html>
<html lang="@(lang)">
<head>
  <!-- https://de.wikipedia.org/wiki/Bootstrap_(Framework) -->
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>@(title)</title>
    <!-- Einbinden des Bootstrap-Stylesheets -->
    <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css">

    <!-- optional: Einbinden der jQuery-Bibliothek -->
    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js"></script>

    <!-- optional: Einbinden der Bootstrap-JavaScript-Plugins -->
    <script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"></script>
  </head>

<body>
    <header>
@{
  Object languageCodeObj=smwprops.get("Language_code");
  String languageCode="de";
  if (languageCodeObj!=null) {
    languageCode=languageCodeObj.toString();
  }
}
    </header>
    <section class="container">
      <h2>SMW Properties</h2>
      <!-- Tabelle mit abwechselnder Zellenhintergrundfarbe und Außenrahmen -->
      <table class="table table-striped table-bordered">
        <thead>
          <tr>
            <th>#</th>
            <th>Name</th>
            <th>Value</th>
          </tr>
        </thead>
        <tbody>
@{int index=0;}
        @for(String key:smwprops.keySet()) {
          <tr>
            <td>@(index++)</td>
            <td>@(key)</td>
            <td>@(smwprops.get(key))</td>
           </tr>
        }
        </tbody>
      </table>
      <article>@(content)</article>
    </section>
  </body>
</html>