{% extends "schedule2/master.html" %}

{% block title %}Weekly MRI Schedule{% endblock %}

{% block dojoHead %}
{% endblock %}

{% block pagehead %}
  <link rel="stylesheet" type="text/css" href="{{ mediaPrefix }}/style/vendor/DatePicker.css" />
  <link rel="stylesheet" type="text/css" href="{{ mediaPrefix }}/style/schedule/master.css" />
  <link rel="stylesheet" type="text/css" href="{{ mediaPrefix }}/style/schedule/colours.css" />
  <!--[if IE]>
  <link rel="stylesheet" type="text/css" href="{{ mediaPrefix }}/style/hacks_ie.css" />
  <![endif]-->
  <script type="text/javascript">
    var scheduleSmdPath = "{{ uriPrefix }}/rpc2/schedulesmd/";
    var mediaUrl = '{{ mediaPrefix }}';
  </script>
  <script type="text/javascript" src="{{ mediaPrefix }}/behaviour/schedule/master.js" charset="utf-8"></script>
{% endblock %}

{% block bodyparams %}{% if view.canUpdateSystem %} class="viewerisadmin"{% else %} class="viewerisnotadmin"{% endif %}{% endblock %}

{% block content %}

<h2 id="schedheading"><span class="greyed">Week commencing:</span> <span id="scheddate"><span class="greyed">loading&hellip;</span></span></h2>
{% if view.canUpdateSystem %}
<p id="weekshownbox" class="active adminonly">
    <input type="checkbox" name="weekshown" id="weekshown" />
  {% if view.showInlineHelp %}
    <label for="weekshown">Week shown to users?</label>
  {% else %}
    <label for="weekshown">published</label>
  {% endif %}
</p>
{% else %}
{% endif %}
  <div id="weeklinks">
    <p class="left">
      <a class="viewprevweek" href="#">&laquo; Prev week</a> | 
      <a class="viewnextweek" href="#">Next week &raquo;</a>
    </p>
    <p class="dateselector">
      <input class="DatePicker" type="text" />
    </p>
    <p class="right">
      <a class="viewprevweek" href="#">&laquo; Prev week</a> | 
      <a class="viewnextweek" href="#">Next week &raquo;</a>
    </p>
  </div>
  <div id="schedule">
    <ul id="daydates">
    </ul>

    <div id="layers">
      <ul id="timescale" class="day">
      </ul>

      <div id="earmark" class="modeonlyactive earmark">
      </div>

      <div id="session" class="modeonlydisplay session">
      </div>

      <div id="evlayer">
      </div>
    </div>
  </div>

{% endblock %}


{% block primarysidebar %}

<div class="box">
  <p style="float:right;">
    <a class="zoomin" href="#">In (+)</a> |
    <a class="zoomout" href="#">Out (-)</a>
  </p>
  <h2>Week Schedule</h2>
  {% if view.showInlineHelp %}
  <p>You&rsquo;re in the <strong>schedule</strong> section.</p>
  {% endif %}
{% if view.canUpdateSystem %}
  <form id="notesform">
    <p><input type="submit" value="Save notes &raquo;"/></p>
    <fieldset>
    <label>admin notes</label>
    <textarea></textarea>
    <label>unit notes</label>
    <textarea style="height:6em;"></textarea>
    </fieldset>
    <p><input type="submit" value="Save notes &raquo;"/></p>
  </form>
  <form>
    <p><input id="notesedit" type="submit" value="Edit notes &raquo;"/></p>
  </form>
{% else %}
<p>Today: {{localNow.day}}-{{localNow.month}}-{{localNow.year}}</p>
</div>
<div class="box" id="notesbox">
  <h2>This week:</h2>
{% endif %}
  <div id="notesdisplay"><p>Loading...</p></div>

{% if view.canUpdateSystem %}
  <p>

    <!-- input type="button" id="updateview" value="Refresh" / -->
    <input type="button" id="newsession" value="&#43; Create session" class="modeonlydisplay session" style="display:none;" />
    <input type="button" id="newearmark" value="&#43; Create earmark" class="modeonlydisplay earmark" style="display:none;" />
  </p>
{% endif %}{% comment %}endif.view.canUpdateSystem{% endcomment %}
</div>

{% if view.canUpdateSystem %}
<div class="box adminonly">
  <h2>Change view mode:</h2>
  <p>
    <input type="button" id="toearmarks" value="Edit earmarks" class="modeonlyactive earmark" />
    <input type="button" id="tosessions" value="View/edit sessions" class="modeonlyactive session" />
  </p>
</div>
{% endif %}{% comment %}endif.view.canUpdateSystem{% endcomment %}
{% endblock %}

