<%@ Page  Language="VB" MasterPageFile="~/portal.master" AutoEventWireup="false" CodeFile="TimeTable.aspx.vb" Inherits="Faculty_TimeTable"%>

<%-- [Webフォーム]head Start --%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<%-- [Webフォーム]head End --%>

<%-- [Webフォーム]body Start --%>
<asp:Content ID="Content2" ContentPlaceHolderID="msp_asp_cph1" Runat="Server">
    <div class="month-selector">
        <span class="year-month"><%= TargetBeginDate.ToString("yyyy年M月")%></span>
        <asp:Button runat="server" ID="btn_this_month" Text="今月" CssClass="button" />
        <asp:ImageButton runat="server" ID="btn_prev_month" ImageUrl="~/img/cal/btn2.png" />
        <asp:ImageButton runat="server" ID="btn_next_month" ImageUrl="~/img/cal/btn1.png" />   
    </div>

    <asp:ListView runat="server" ID="lv_calendar" GroupItemCount="7">
        <LayoutTemplate>
            <table class="calendar">
                <thead>
                    <tr>
                        <th class="calendar-header sunday">日</th>
                        <th class="calendar-header">月</th>
                        <th class="calendar-header">火</th>
                        <th class="calendar-header">水</th>
                        <th class="calendar-header">木</th>
                        <th class="calendar-header">金</th>
                        <th class="calendar-header saturday">土</th>
                    </tr>
                </thead>
                <tbody>
                    <tr runat="server" id="groupPlaceholder"></tr>
                </tbody>
            </table>
        </LayoutTemplate>
        <GroupTemplate>
            <tr class="calendar-row">
                <td runat="server" id="itemPlaceholder"></td>
            </tr>
        </GroupTemplate>
        <ItemTemplate>
            <td class="calendar-cell" data-today='<%# If(DirectCast(Container.DataItem, DateTime).ToString("yyyy/MM/dd") = Now.ToString("yyyy/MM/dd"), "true", "")%>'>
                <span class="schedule-date">
                    <%# DirectCast(Container.DataItem, DateTime).ToString("d ")%>
                </span>
                <asp:ListView runat="server" ID="lv_schedule">
                    <LayoutTemplate>
                        <ul class="schedule-list">
                            <li runat="server" id="itemPlaceholder"></li>
                        </ul>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <li class="schedule-list-item" data-overall='<%# CreateLabel1(Container.DataItem)%>' secound-row='<%# CreateLabel2(Container.DataItem)%>'>
                            <%# GetCreatedLabel()%>
                        </li>
                    </ItemTemplate>
                </asp:ListView>
            </td>
        </ItemTemplate>
    </asp:ListView>
    <%-- 本日のセルの背景色を変更 --%>
    <script type="text/javascript">
        document.querySelector('td[data-today="true"]').style.backgroundColor = "LightGoldenRodYellow";
    </script>
</asp:Content>
<%-- [Webフォーム]body End --%>