<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>$model.weblog.name</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  #showMetaDescription()
  #showAnalyticsTrackingCode($model.weblog)

  <link rel="stylesheet" href="$model.weblog.stylesheet">
  <link rel="stylesheet" href="$url.absoluteSite/roller-ui/styles/jquery.mobile-theme/default.min.css" />
  <link rel="stylesheet" href="$url.absoluteSite/roller-ui/styles/jquery.mobile-theme/jquery.mobile.icons.min.css" />
  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile.structure-1.4.2.min.css" />

  <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>

  <script>

    $(document).bind("mobileinit", function(){
      $.mobile.ajaxEnabled = false;
    });

  </script>

  <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>

  <script>
    $(document).bind("pageinit", function(){
      $('#btnStandard').on('click', function() {
        setCookie("roller_user_request_type","standard",30);
        $("#btnStandard").attr('href', '?deviceType=standard').click();
      });
    });
    function setCookie(c_name, value, exdays) {
      var exdate = new Date();
      exdate.setDate(exdate.getDate() + exdays);
      var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString() + "; path=/");
      document.cookie = c_name + "=" + c_value;
    }
  </script>
</head>
<!-- weblog-mobile -->
<body>
  <div id ="home" data-role="page">

    <div data-role="header" data-theme="a">
      <h1>$model.weblog.name</h1>
      <a href="$url.absoluteSite" data-icon="home" data-theme="a">Home</a>
      <a href="#" id="btnStandard" data-role="button">View Standard</a>
    </div>

    <div role="main" class="ui-content">

      ## Search
      #showMobileSearchForm($model.weblog false)

      #set($rootCategory = $model.weblog.getWeblogCategory("nil"))
      #showMobileCategoryLinksList($rootCategory)

      ## show next/previous paging controls
      #set($pager = $model.getWeblogEntriesPager())
      <div class="next-previous">
        #showMobileNextPrevEntriesControl($pager)
      </div>

      ## Show entries
      #if($pager.entries.size() > 0)
        #showWeblogEntriesPager($pager)
      #else
        ## No entries.
        <ul data-role="listview" data-divider-theme="b" data-inset="true">
          <li data-role="list-divider">$utils.formatDate($utils.now, $text.get("macro.weblog.date.toStringFormat"))</li>
          <li data-theme="a">
            <span class="ui-li-desc content-textbox">
              <h3>$text.get("macro.weblog.noEntriesForCategory")</h3>
            </span>
          </li>
        </ul>
      #end

    </div>

    <div data-role="footer" data-theme="a">
      <h4>Apache Roller Mobile</h4>
    </div>

  </div>

</body>
</html>
