<%@ Page Title="Calendar" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="calendar.aspx.cs" Inherits="Calendar" %>

<%@ Register Src="~/Controls/AdvancedForm.ascx" TagPrefix="scheduler" TagName="AdvancedForm" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="Styles/calendar.css" rel="stylesheet" />
    <script src="Scripts/calendar.js"></script>
    <style>
        .kendo-pdf-hide-pseudo-elements:after,
        .kendo-pdf-hide-pseudo-elements:before {
            display: none !important;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FolderContent" runat="Server">

    <telerik:RadCalendar runat="server" ID="RadCalendar1" Skin="Metro" EnableMultiSelect="false"
        DayNameFormat="FirstTwoLetters" EnableNavigation="true" SelectedDate="09/01/2015"
        EnableMonthYearFastNavigation="true" ShowRowHeaders="false" Width="240px">
        <ClientEvents OnDateSelected="calendar.onCalendarDateSelected" OnCalendarViewChanged="calendar.onCalendarViewChanged" />
    </telerik:RadCalendar>

    <nav:FolderNavigationControl runat="server" ID="FolderNavigationControl" Category="Calendar" ReadOnly="True" />
    <nav:MobileNavigation runat="server" ID="MobileNavigation" Category="Calendar" BreadCrumbText="Types"></nav:MobileNavigation>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server">
    <telerik:RadNavigation runat="server" ID="calendarNavigation" Skin="BlackMetroTouch" OnClientNodeClicked="calendar.clientNodeClicked" CssClass="secondaryMenu">
        <Nodes>
            <telerik:NavigationNode Text="New" SpriteCssClass="icon icon-Add-Circle">
            </telerik:NavigationNode>
            <telerik:NavigationNode Text="Export">
                <Nodes>
                    <telerik:NavigationNode Text="Export to PDF"></telerik:NavigationNode>
                    <%--Uncomment the following item, in order to test the Export iCal format locally--%>
                    <%--<telerik:NavigationNode Text="Export to iCalendar" NavigateUrl="api/calendar/ical"></telerik:NavigationNode>--%> 
                    <telerik:NavigationNode Text="Export to Image"></telerik:NavigationNode>
                </Nodes>
            </telerik:NavigationNode>
            <telerik:NavigationNode Text="Import"></telerik:NavigationNode>
            <telerik:NavigationNode CssClass="rightScndNav">
                <NodeTemplate>
                    <telerik:RadSearchBox runat="server" Skin="BlackMetroTouch" Width="340px" ID="mainSearch"
                        CssClass="hidden" ShowLoadingIcon="false" MaxResultCount="10">
                        <WebServiceSettings Path="api/calendar" Method="search" UseHttpGet="false" />
                    </telerik:RadSearchBox>
                    <span class="button searchBtn">
                        <span class="icon icon-Search"></span>
                    </span>
                </NodeTemplate>
            </telerik:NavigationNode>
        </Nodes>
    </telerik:RadNavigation>

    <div class="scroller">
        <telerik:RadScheduler
            runat="server"
            ID="RadScheduler1"
            ValidationGroup="RadScheduler1ValidationGroup"
            Skin="MetroTouch"
            Height="100%"
            OnClientFormCreated="calendar.schedulerFormCreated"
            OnClientNavigationComplete="calendar.onClientNavigationComplete"
            SelectedView="DayView"
            SelectedDate="09/01/2015"
            ShowFooter="false"
            OnDataBound="RadScheduler1_DataBound"
            DayStartTime="08:00:00"
            DayEndTime="21:00:00"
            FirstDayOfWeek="Monday"
            LastDayOfWeek="Friday"
            EnableDescriptionField="true"
            CustomAttributeNames="Location,Invitees"
            ShowDateHeaders="false">
            <AdvancedForm Modal="true" EnableCustomAttributeEditing="true" EnableTimeZonesEditing="false" Width="500px" />
            <Reminders Enabled="true" />
            <AdvancedEditTemplate>
                <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit"
                    Subject='<%# Bind("Subject") %>' Location='<%# Bind("Location") %>' Invitees='<%# Bind("Invitees") %>'
                    Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'
                    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Reminder='<%# Bind("Reminder") %>' />
            </AdvancedEditTemplate>
            <AdvancedInsertTemplate>
                <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert"
                    Subject='<%# Bind("Subject") %>' Location='<%# Bind("Location") %>' Invitees='<%# Bind("Invitees") %>'
                    Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'
                    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Reminder='<%# Bind("Reminder") %>' />
            </AdvancedInsertTemplate>
            <TimelineView UserSelectable="false"></TimelineView>
            <TimeSlotContextMenuSettings EnableDefault="false" />
            <AppointmentContextMenuSettings EnableDefault="false" />
            <Localization HeaderWeek="Work week" AdvancedNewAppointment="New Event" AdvancedEditAppointment="Edit Event" />
            <WebServiceSettings Path="api/calendar" ResourcePopulationMode="ServerSide" UseHttpGet="true" />
            <ResourceStyles>
                <telerik:ResourceStyleMapping Type="Calendar" Text="Personal" BackColor="#9BCBFC" />
                <telerik:ResourceStyleMapping Type="Calendar" Text="Work" BackColor="#B0D96F" />
                <telerik:ResourceStyleMapping Type="Calendar" Text="Development" BackColor="#DEACFF" />
                <telerik:ResourceStyleMapping Type="Calendar" Text="Design" BackColor="#F49797" />
                <telerik:ResourceStyleMapping Type="Calendar" Text="Marketing" BackColor="#F9B656" />
            </ResourceStyles>
        </telerik:RadScheduler>
    </div>
    <div class="hidden">
        <telerik:RadAsyncUpload runat="server" ID="asyncUpload" OnClientFileUploaded="calendar.fileUploaded" 
            HttpHandlerUrl="~/Handlers/ICalendarHandler.ashx"></telerik:RadAsyncUpload>
    </div>
    <telerik:RadClientExportManager runat="server" ID="clientExportManager" ClientIDMode="Static"></telerik:RadClientExportManager>
</asp:Content>